From: Brian Candler Date: 2009-11-20T18:33:06+09:00 Subject: Re: eval behaves differently inside a method definition... There is the existing TOPLEVEL_BINDING constant you can use for this. >> class String; def irb; eval self, TOPLEVEL_BINDING; end; end => nil >> "class Pumpkin;def pie;puts 'yum';end;end".irb => nil >> Pumpkin.new.pie yum => nil >> -- Posted via http://www.ruby-forum.com/.