From: Greg Weeks Date: 2007-11-17T07:59:23+09:00 Subject: Re: "instance_eval" (eg, sent to a class object) > It changes 'self' to the receiver, for the duration of the block. > It only affects the execution context by binding self to the instance And the value of self affects: - explicit uses of "self" - naked message-sends - instance and class variable access Anything else? Hmmm. This is still a mystery: class Foo end Foo.instance_eval do def foo ; "foo" ; end end p Foo.singleton_methods -> ["foo"] The "def" should have gone into the top-level environment, but it went into <