From: Julian Leviston Date: 2005-08-25T07:59:39+09:00 Subject: Re: determining the attribute names of an object Yeah, Instance variables are a concern of the developer of the object, but attributes are a concern of the user of the object. Julian. On 25/08/2005, at 12:53 AM, James Edward Gray II wrote: > 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 > > >