2006/5/20, Alder Green <alder.green / gmail.com>:
> irb(main):001:0> class Bar; def foo=(val); puts "Bar#foo= called!"; end; end
> irb(main):002:0> Bar.new.instance_eval { foo = 1 }          #=> no output
> irb(main):003:0> Bar.new.instance_eval { foo= 1 }           #=> no output
> irb(main):004:0> Bar.new.instance_eval { self.foo = 1 }   #=> Bar#foo= called!
>
> It seems like the only way to call Bar#foo= inside and instance of Bar
> is by prefixing self explicitly. Am I right about this?

Yes.  foo= is a local variable assignment. See
http://ruby-doc.org/docs/ProgrammingRuby/html/tut_expressions.html#S3
(you'll have to scroll down a bit).

Kind regards

robert

-- 
Have a look: http://www.flickr.com/photos/fussel-foto/