From: Andrew Stewart Date: 2007-03-08T21:18:26+09:00 Subject: Re: How To Find The Name Of A Variable On 8 Mar 2007, at 12:09, Pit Capitain wrote: > Andy, you could try to change the way you create your line item > objects. Instead of storing them in separate instance variables, > you could store them in a Hash. Instead of > > @line_item_jacket = create_line_item_jacket > @line_item_shirt = create_line_item_shirt > > you could do something like > > @line_items = {} > @line_items[ :line_item_jacket ] = create_line_item_jacket > @line_items[ :line_item_shirt ] = create_line_item_shirt > > then you can just do > > if line_item_relevant :line_item_shirt Pit, that's a neat approach. I'll try it. Thank you! Andy