Subject: How to copy a method from one class to another
From: "Sam Kong" <sam.s.kong gmail.com>
Date: Tue, 26 Sep 2006 01:10:17 +0900
Hi Rubyists,
Is there a way to copy an instance method from one class to another?
class C1
def f
p self.class
end
end
class C2
end
Now I want C2 to have f method so that I can call C2.new.f.
Thanks.
Sam