From: George Moschovitis Date: 2005-01-26T01:40:50+09:00 Subject: Re: Injecting methods from one class into another. > I do not think what you want has anything to do with 'duck typing'. Of course it has. Have a look at the following example: class C1 attr_accessor :a def a1 puts @a end def a2 puts 'hello' end end class C2 attr_accessor :a end So for method C1#a1 the class C2 'quacks like a duck' (ie, it has the attribute @a) So in 'duck typing' spirit, it should be possible to do: c = C2.new m = C1.instance_method(:a1) m.bind(c) c.a1 however Ruby raises a TypeError :( Can anyone give me an example, where this #bind method is usefull? I mean, you can only bind a Method back to an object of the original method's Class or a Subclass. But such an object allready has this method, so whats the point? Am I missing something here? regards, George