From: Sebastian Hungerecker Date: 2008-02-02T03:05:18+09:00 Subject: Re: @var = change to accessor method? Why? Day wrote: > So... what's the advantage of changing > > class Thing >   attr_accessor :a > >   def do_something(arg) >     @a = arg >   end > end > > to... > > class Thing >   attr_accessor :a > >   def do_something(arg) >     self.a = arg >   end > end If you ever decide that the setter method should do more than just change the var (like for example validate the input and then change the var), you can replace the method created by attr_accessor with your own. Places where you directly assign to @a won't benefit from that change, though. HTH, Sebastian -- Jabber: sepp2k@jabber.org ICQ: 205544826