2006-02-14 eval Rubyのevalを使うと…evalできます。 s = <<"EOD" class Rubyco def self.hello puts "Hello!" end end EOD # Rubyco.hello #=> uninitialized constant Rubyco eval s Rubyco.hello #=> Hello! eval s.gsub(/Hello/, "Good") Rubyco.hello #=> Good!