From: dblack@... Date: 2007-02-03T22:12:46+09:00 Subject: Re: Calling a method whose name I only know at run-time Hi -- On Sat, 3 Feb 2007, Jan Svitok wrote: > On 2/3/07, Chad Thatcher wrote: >> Oops, solved it. Sorry, I missed Object#method the first time around. >> 8) > > And there is the Object#send that will do what you want, i.e. > any_object.send("method1", arg1, arg2) > > or > > any_object.send("method1", *args) > > (if send insists on symbols for method names, use String#to_sym) It doesn't; you can use either. David -- Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com)