On Aug 24, 2005, at 9:43 AM, Mark Volkmann wrote:

> I really don't get this. Can you give a definition of each of the
> terms "instance variable" and "attribute"?  I'm pretty sure most
> people that have been doing OO development for years would say that
> they thought those were the same thing. Maybe many of us were sleeping
> in class when those concepts were taught. ;-)

Well, here's an example:

class Name
     def initialize( first, last )
         @first, @last = first, last
     end

     attr_accessor :first, :last

     def full_name
         "#{@first} #{@last}"
     end

     def full_name=( name )
         @first, @last = name.split
     end
end

I would say that the above class has a full_name attribute, but it  
certainly does not have a @full_name instance variable.

Hope that helps.

James Edward Gray II