Can anyone explain the use of instance_eval and provide the example?
Google “instance_eval” first results in the list:
http://redhanded.hobix.com/inspect/testingDeeplyWithInstance_eval.html
http://toolmantim.com/article/2006/11/29/instance_eval_brings_sexy_back
http://www.infoq.com/articles/eval-options-in-ruby
http://blog.jayfields.com/2007/03/ruby-instanceeval-and-classeval-method.html
Best regards
Peter De Berdt
The third links is fruitful.
Can one one simplify it more?
I think, it is used to include a variable in the instance which is not originally available in the class.