require 'delegate'

a = Object.new
def a.test
  p 1
end

b = Object.new
def b.test
  p 2
end
c = SimpleDelegator.new( a )
c.test

p c.__getobj__
c.__setobj__ SimpleDelegator.new( b )

c.test