From: Paul Lutus Date: 2006-12-02T05:45:05+09:00 Subject: Re: Simple iteration in a function problem Blake Miller wrote: >> Please show us your code, and make it as simple as possible. Like this: > > > class Widget > > def initialize(title) > @components = Array.new > end > > def add_component(component) > @components << component > end > > def component(uniqueId) # note: uniqueId is a string What? "uniqueId" is string? It cannot be a string, it has to be an ID, something gotten with ".object_id", nothing else will do. And two strings with the same content do not necessarily have the same ID. In your method "uniqueId", you should be returning "self.object_id". In your code, I do not see where you acquire the ".object_id" of any object. Very basically, in order to solve a problem like this, you simply must post a short, terse, concise bit of code, that (1) can be run by a newsgroup reader, and (2) shows the problem. Posting bits and pieces of code, but never a short working example, is a sure way to assure that this thread will go on forever. -- Paul Lutus http://www.arachnoid.com