Subject: Designing a Cabinet class
	Date: gio 27 giu 13 09:07:09 +0900

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

> While sample code that would create a functioning Cabinet class is
> appreciated, I feel that my lack of understanding doesn't simply stem
> from the fact that I don't know the exact code, but rather that I do not
> understand a more general concept of ruby programming. Explanations that
> would help with this would be appreciated. Thanks!

Your idea of creating a drawer class is not only a good Ruby practice:
it is THE sound object-oriented direction to take: the cabinet holds
drawers, and the drawer holds objects. Experiment with creating such a
class, and assigning to it the property of holding objects: the add,
remove, and test methods should belong there.

Your cabinet will then contain an array (or maybe a hash) of
drawers. And your drawer will contain an array (or maybe a hash) of
objects.

If you are not familiar with hashes or arrays, there is much to read
about them. If you are not familiar with the Ruby implementation of
arrays and hashes, you can type this:

ri Array

and 

ri Hash

These manual pages are quite well-made...

Happy coding

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)