From: James Britt Date: 2005-12-31T00:51:16+09:00 Subject: Re: Method for turning strings into code Steve Litt wrote: > Hi all, > > What is the Ruby technique for turning strings into executable code? There's eval: eval( 'class Foo;def x; puts "x"; end;end' ) Foo.new.x And its variants (instance_eval, class_eval) James -- http://www.ruby-doc.org - Ruby Help & Documentation http://www.artima.com/rubycs/ - Ruby Code & Style: Writers wanted http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys http://www.30secondrule.com - Building Better Tools