From: Adriano Nagel Date: 2010-05-20T13:12:14+09:00 Subject: Re: define_method inside instance_eval Dhruva Sagar wrote: > def status_field(*args) > (class << self; self; end).instance_eval { define_method(:status_all) { > args } } > end Yep, this works. Notice that, once you open the metaclass, you can use either instance_eval or class_eval to define a singleton method. I guess I still can't come to terms with define_method not generating a singleton method when used inside instance_eval :-) This is on Ruby 1.8.7. Maybe this is a bug? Regards, -- Adriano -- Posted via http://www.ruby-forum.com/.