Hi --

On Sun, 7 May 2006, Logan Capaldo wrote:

> I would suggest using the attr_* methods or writing your own accessors for 
> any case where you might need to access an instance varible
>
> @something = exp
>
> is probably a bad sign anywhere but initialize and/or
>
> def something=(x)
> ...
> end
>
> likewise a = @something should almost always be a = self.something

It all depends.  The attr_* family uses instance variables to do what
it does, but there's no reason that should be viewed as the only or
best or likeliest use of instance variables.  It's layered on top of
a subsystem (instance variables) that have other uses too.


David

-- 
David A. Black (dblack / wobblini.net)
* Ruby Power and Light, LLC (http://www.rubypowerandlight.com)
   > Ruby and Rails consultancy and training
* Author of "Ruby for Rails" from Manning Publications!
   > Paper version coming in early May! http://rubyurl.com/DDZ