From: Trans Date: 2007-03-13T20:06:48+09:00 Subject: Re: get object from its object-specific class? On Mar 11, 10:23 am, ara.t.how...@noaa.gov wrote: > On Sun, 11 Mar 2007, Thomas Hafner wrote: > > Hello, > > > is there a way to get an object, if only its object-specific class is > > given? For instance, given > > > c = class << Hash[:a, 5] > > def mult(x) > > self[:a] * x > > end > > self > > end > > > can I retrieve the hash object via evaluation of c? > > harp:~ > cat a.rb > c = class << Hash[:a, 5] > def mult(x) > self[:a] * x > end > self > end > > p c.instance_eval{ self } > > harp:~ > ruby a.rb > #> I thought we wanted the result to be #? T.