From: Adam Anderson Date: 2007-11-07T10:46:41+09:00 Subject: instance_eval to evaluate methods inside a block in context http://pastie.caboo.se/114839 Can anyone tell me why this wouldn't/shouldn't/should work? I don't want to pull out all of my hair trying to figure this out if it isn't even possible. Thanks, Adam class Calculator def evaluate(&script) self.instance_eval(&script) end def two "2" end end class Foo def hi puts "hi" end def howdy Calculator.new.evaluate do puts two hi end end end Foo.new.howdy Attachments: http://www.ruby-forum.com/attachment/920/w.rb -- Posted via http://www.ruby-forum.com/.