From: Rudolf Polzer Date: 2003-03-15T06:42:49+09:00 Subject: Re: dynamically create a method Scripsit ille �Joel VanderWerf� : > Rudolf Polzer wrote: > > But I'd still like to know how to dynamically create a method with a > > dynamically given name. If possible, without such a hackery. > > irb(main):003:0> Fixnum.instance_eval {define_method(:power) do |a| self > ** a end} > # > irb(main):004:0> 3.power 2 > 9 > > The instance_eval is because it's a private method. Thanks... but where is it documented? I know rb_define_method (so I should have just tried without the rb_)... -- [mpg123d] Just playing: .../MP3/ayumi hamasaki/a best/07 trauma.mp3 Doch - alles, was dazu mich trieb, Gott! war so gut! ach, war so lieb!