Subject: Turning a proc into a method?
From: "Arlen Christian Mart Cuss" <celtic@ i x r
Date: Sat, 10 Nov 2007 19:03:59 +0900
Hi all,
Any ideas on how to convert a proc into a method? Here's an example, but..
it seems not so great.
class Proc
def to_global_method
func = self
Kernel.module_eval { define_method(:some_name) { |*a| func.call *a } }
end
end
Cheers,
Arlen.