Hi,

this is the very difference between instance_eval and class_eval: A 
"def" expression in instance_eval will always create a singleton method. 
If you want an instance method (i. e. the same behaviour as inside a 
class body), you have to use class_eval.

This is explained further in the book "The Ruby programming language":

http://books.google.de/books?id=jcUbTcr5XWwC&pg=PA270

-- 
Posted via http://www.ruby-forum.com/.