Brandon Coleman wrote:
> 
>> dealership_obj = Dealership.new
>> puts dealership_obj.honda
>> puts dealership_obj.ford
>> 
> 
> Yes it is! but I would like to be able to add and delete objects on the 
> fly.  For instance I want to add Toyota: could the objects be stored in 
> an array so that I could add an object and delete an object when I 
> needed?  I would like to be able to say something like 
> dealership.add(toyota.new(etc etc)) dealership.puts(toyota) I think 
> talking about it is showing the weakness of my idea. because then I 
> would probably need a dealership.modify(toyota.something()) and I would 
> really like to nest my objects about 4 deep.
> Talking about it brought me to this example:
> 
> dealership.modify(toyota.modify(shelfb.add(bin1.new(carburetor)))).
> 
> which IS what I think I would like to do, I just think that code is ugly 
> and illedgible, and so I feel there is probably a better way.
> 
> Brandon
...brandon...while i'm still a newbie at this....a perfect example is 
the free tutorial learn-ruby...that does exactly what you want but with 
address book as an example....each person is an address entry (really a 
hash storing name,email,address,city,state) aka a car object (with hash 
keys like carb tranny,etc...)...then an address book
is an object collection of many persons objects collected into an 
array....

-- 
Posted via http://www.ruby-forum.com/.