From: Florian Gilcher Date: 2009-04-29T19:07:18+09:00 Subject: Re: Why does attr_accessor in module require 'self.'? On Apr 29, 2009, at 10:11 AM, Shaun Keller wrote: > The short answer would be that > > a = 'bar' > > is a local variable assignment, whereas > > self.a = 'bar' > > is an instance variable assignment, like @a > -- > Posted via http://www.ruby-forum.com/. > No, a = 'bar' is local variable assignment, whereas self.a = 'bar' is a method call. Where #a= was defined through attr_accessor :a and has the side effect of assigning an @variable. It is totally possible to implement #a= without having it assign a variable - it is in no way special. All you do is force that method call by explicitly mentioning a receiver.