From: Eero Saynatkari Date: 2006-09-04T11:24:28+09:00 Subject: Re: Does an instance know his own name? Geoff Barnes wrote: > If a class has built checks and raises an exception if it finds > something wrong, how can I tell which instance had the error? I know > there's an object_id, but can I know the name of the objects own > instance variable? > > > > Also, can an instance know his 'path' from the top-level? > > No and no (at least, no sensible way). You are dealing with symbolic names 'huey' versus actual references and objects. The 'proper' way is to have the object know its name: huey = Nephew.new 'Huey' > Thanks, -- Posted via http://www.ruby-forum.com/.