From: Love U Ruby Date: 2013-07-23T20:18:31+09:00 Subject: Re: How can we create instance method and class methods at runtime in ruby? Stefano Crocco wrote in post #1116318: > On Tuesday 23 July 2013 Love U Ruby wrote > > Foo.class_eval do > define_method(:test){p 'hello'} > end > > or you can use send: > > Foo.send :define_method, :test, &proc{p 'hello'} > > I hope this helps > > Stefano Thanks @Stefano - this is what I was looking for.. :) -- Posted via http://www.ruby-forum.com/.