From: Ryan Davis Date: 2009-04-29T17:35:36+09:00 Subject: Re: Why does attr_accessor in module require 'self.'? On Apr 28, 2009, at 16:34 , 7stud -- wrote: > I guess the idea here: > >> def bar >> a = "bar" #<----**** >> end >> >> def baz >> self.a = "baz" >> end > > is that when you call a method without a receiver, self is implied. > So > the bar method would be equivalent to: > >> def bar >> self. a = "bar" #<----**** >> end >> > > Therefore bar and baz have the same format and should do the same > thing. > But... no. consider local variable assignment to be higher precedence than message send. var = val will ALWAYS be local variable assignment, even if you have #var=.