From: itsme213 Date: 2005-04-01T15:44:50+09:00 Subject: how to simulate self-style delegation I have classes A and B. class A def x "A::x " end def xy self.x + "A::y" end end class B def initialize a @a = a end def x "B::x " end def method_missing ??? ?? SELF-style delegate to @a end end I want true SELF-style delegation from objects of class B to A. i.e. self calls on an A are in the context of the delegating B (if any). a = A.new a.xy #=> "A::x A::y" b = B.new a b.xy #=> "B::x A::y" # calls b.method missing # calls a.xy # calls b.x #=> "B::x" # calls a.y #=> "A::y" # return "B::x A::y" How can I do this? Thanks!