require 'delegate'
a = Object.new
def a.f
p 1
end
b = Object.new
def b.f
p 2
end
c = SimpleDelegator.new( a )
c.f
p c.__getobj__
c.__setobj__ SimpleDelegator.new( b )
c.f
cmVxdWlyZSAnZGVsZWdhdGUnCgphID0gT2JqZWN0Lm5ldwpkZWYgYS5mCiAgcCAxCmVuZAoKYiA9IE9iamVjdC5uZXcKZGVmIGIuZgogIHAgMgplbmQKYyA9IFNpbXBsZURlbGVnYXRvci5uZXcoIGEgKQpjLmYKCnAgYy5fX2dldG9ial9fCmMuX19zZXRvYmpfXyBTaW1wbGVEZWxlZ2F0b3IubmV3KCBiICkKCmMuZg==