From: Ben Tilly Date: 2007-10-21T19:08:20+09:00 Subject: Re: Anonymous classes? 7stud -- wrote: > Ben Tilly wrote: > How about something like this: > > Dog = Class.new { > def self.create_method(name, proc_) > self.send(:define_method, name, proc_) > end > } > > > p = lambda {puts "Woof, woof."} > Dog.create_method(:bark, p) > > d = Dog.new > d.bark I tried this, but when I went with my inherited objects, I was not picking up the IDs of the inherited objects correctly. Cheers, Ben -- Posted via http://www.ruby-forum.com/.