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!