From: Patrick Li Date: 2008-08-20T00:30:18+09:00 Subject: Easy code generation in Ruby. Hi, I know how to dynamically create methods and classes in Ruby, but is there anyway to save these methods to a file? eg. I'm looking for something like this: define_method_in_file("File.rb", :myMethod) do instance_variable_set(:@a, "myString") end to produce: def myMethod @a = "myString" end Thanks a lot for answering. I'm hoping there's something easier than having to mess about with templates. -Patrick -- Posted via http://www.ruby-forum.com/.