Scripsit ille oel VanderWerf¥© <vjoel / PATH.Berkeley.EDU>:
> 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}
> #<Proc:0x40210220@(irb):3>
> 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!