From: Steve Litt Date: 2005-12-31T01:06:56+09:00 Subject: Re: Method for turning strings into code On Friday 30 December 2005 10:51 am, James Britt wrote: > 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 Thanks James, and you to Johannes. SteveT Steve Litt http://www.troubleshooters.com slitt@troubleshooters.com