From: vasudevram Date: 2007-08-02T21:25:00+09:00 Subject: Re: defining methods dynamically? Kenneth McDonald wrote: >Having looked through the Class and Method rdoc, and the Reflection section of Pickaxe, and still not seeing anything (even though it was probably right in front of my nose), I'm forced to fall on the mercy of strangers and ask...how does one add a method to a class while the program is running? I think there are at least two ways to do it, both of which I've seen in the Ruby Cookbook. One uses define_method, as one of the other posters said; the other uses module_eval, IIRC. There's also an example using module_eval in the Pickaxe - 2nd edition. Vasudev Ram http://www.dancingbison.com http://jugad.livejournal.com http://sourceforge.net/projects/xtopdf