From: Its Me Date: 2004-04-24T00:29:16+09:00 Subject: attr_accessor vs. local variable Ruby not seem to predictably recognize attribute accessors (including setters) as such unless preceded by "self.attr". But it recognizes other self messages fine. I suspect this has something to do with its rule on what is deemed a local variable. What rule / ambiguity causes this? class A attr_accessor :x, :y def initialize p x # local or @x? x=5 # does not call self.x= self.y=5 # sets @y foo # calls self.foo end def foo p 'foo' end end p A.new.x p A.new.y