Does this work? I don’t have Ruby handy:
@obj = obj
@class = obj.class.superclass
def method_missing(sym, *args, &blk) @class.instance_method(sym).bind(obj).call *args, &blk end
@proxy = SuperProxy.new(self) unless @proxy
Apologies if there are formatting errors, I’m on webmail.
Charles Comstock firstname.lastname@example.org wrote:
Gah that’s nasty. You can get the superclass automatically with
so I guess you can do it with
self.class.superclass.instance_method( :foo ).bind(self).call
so I wonder if there is a way to make a singleton or temporary class
which could be returned by say parent allowing you to just use
to just do all of above. Clearly this doesn’t seem to be something
that is supposed to be easy. Perhaps someone knows why?
Thanks for the help anyway,