Subject: Re: define_method to add a Class method?
From: Pit Capitain <pit@ p a . >
Date: Sat, 3 Jul 2004 05:51:32 +0900
References: 105124105129
In-reply-to: 105129
walter / mwsewall.com schrieb:
> <snip>
> I want to add a method to the class itself, and I want to be
> able to do it to an anonymous class.
c = Class.new do
class << self
define_method :m do p "m" end
end
end
c.m # ==> "m"
HTH
Regards,
Pit