So I decided to take Carlo's advice and make an effort to create a
separate Drawer class, moving the #place and #remove functionality over
from the Cabinet class to the Drawer class. I also added #open and
#close functionality to the Drawer as well. I think I correctly wrote
the code for #open, #close, and #place, but I'm having quite a bit of
difficulty with #remove. Adding an element to an array is simple enough,
but to remove a specified item in that array is proving a bit more
difficult.

What I'm trying to do:

When a user goes to remove an item from the drawer, they will be
presented with a list of items in the drawer. This list will be
populated by the drawer_contents array. Instead of asking them to type a
number that would correspond to the the item's array index, I want them
to simply type the item name and have it removed from the
drawer_contents array. I feel like there should be an easy way to do
this, but I am stumped.

Once again, I've attached the file I'm working on for reference. Thanks!

~Mike

Attachments:
http://www.ruby-forum.com/attachment/8546/drawer.rb


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