Subject: Re: Designing a Cabinet class
	Date: gio 27 giu 13 09:53:49 +0900

Quoting Mike Vezzani (lists / ruby-forum.com):

> Thank you for your reply. I had a feeling that this was going to be the
> proscribed approach. My next question, then, is how to get objects to
> play together. Is this where :belongs_to and :has_many come into play?
> Please don't feel obligated to give me a comprehensive response if you
> feel that there is a good piece written on the subject that you could
> point me to. Thanks!

You are mixing environments here. :belongs_to and :has_many are
concepts that relate to how you map objects to database tables. They
are not part of Ruby. You should investigate subjects like Datamapper
and ActiveRecord to understand more about them. This list won't be of
much help about those territories. 

In Ruby, your cabinet has drawers as soon as you create an instance
variable that holds the drawers. So, for example, your Cabinet class
may contain something like:

@drawers=[Drawer::new(...),Drawer::new(...),...]

and from that point on, your cabinet will have drawers.

Carlo

-- 
  *         Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido / fluido.as             che bisogno ci sarebbe
  *               di parlare tanto di amore e di rettitudine? (Chuang-Tzu)