On Mar 7, 9:02 am, Brian Candler <B.Cand... / pobox.com> 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.