Is it possible to make yield keyword work inside a block given to define_method? Simple example:
class Test define_method :test do |&b
I think this is what you're looking for:
class Test define_method :test do |&b| b.call end end Test.new.test { puts "Hi!" }
More at http://coderrr.wordpress.com/2008/10/29/using-define_method-with-blocks-in-ruby-18/