From: Trans Date: 2007-03-08T07:38:11+09:00 Subject: Re: object_* and instance_* methods On Mar 7, 9:02 am, Brian Candler wrote: > > I think this could be implemented using a proxy object / delegator. > > But actually, there's no need to pass any method calls through. You could > just have a Reflector object: > > def process(a) > b = Reflector.new(a) > b.instance_methods.each { ... } > ... > end I think that could be a damn good idea! Is there room for two exceptions? class Object def object @_object_reflector ||= Reflector.new(self) end def instance @_instance_reflector ||= InstanceReflector.new(self) end end foo.object.id foo.instance.send(:P) (*ducks*) T.