From: timr Date: 2009-11-21T20:25:09+09:00 Subject: Re: eval behaves differently inside a method definition... Thank you Brian. Even better. On Nov 20, 1:33 am, Brian Candler wrote: > There is the existing TOPLEVEL_BINDING constant you can use for this. > > >> class String; def irb;evalself, TOPLEVEL_BINDING; end; end > => nil > >> "class Pumpkin;def pie;puts 'yum';end;end".irb > => nil > >> Pumpkin.new.pie > > yum > => nil > > -- > Posted viahttp://www.ruby-forum.com/.