From: Erik Veenstra Date: 2006-03-21T19:38:54+09:00 Subject: Re: Method overload, care to improve? > Is it possible to execute a method in a specific context, As long as the objects are of the same class, you could use Method#unbind and UnboundMethod#bind. If they aren't, you could experiment with Method#to_proc. > @@foo = Generic.new Why?... gegroet, Erik V. - http://www.erikveen.dds.nl/ ---------------------------------------------------------------- class Foo def bar self.object_id end end foo1 = Foo.new foo2 = Foo.new p foo1.bar p foo2.bar p foo1.method(:bar).unbind.bind(foo2).call p Foo.instance_method(:bar).bind(foo2).call ----------------------------------------------------------------