From: Brian Candler Date: 2009-06-02T16:31:44+09:00 Subject: Re: eval? instance_eval?? hmm Steve Hull wrote: >> Here's it's because you turned the hash into a string, and then inserted >> the string into your code, and then tried to run it. > > Believe it or not, I did realize that. I just couldn't find any docs > showing me the proper usage of the string form of "instance_eval" (ie, > passing an argument). I wouldn't expect there to be any. eval or instance_eval with a string just parses and runs Ruby code, so the proper usage is "just put some valid Ruby code in there" :-) That's why it's useful to use puts for debugging - you can see at a glance whether that code would be valid or not, if you had just inserted it into your program at that point. > Thanks for the helpful replies! I got it working exactly how I wanted. No problem, glad it's all making sense. Cheers, Brian. -- Posted via http://www.ruby-forum.com/.