From: Phillip Hutchings Date: 2006-07-24T09:50:57+09:00 Subject: Re: How to run variable method names? On 7/24/06, Ben Johnson wrote: > Lets say object has a method called id. > > How do I do the the following? > > method_name = "id" > object.method_name > > I know the above doesnt work, but I want method_name to be replaced > by its value so it would run id. In this case Ruby is interpreting method_name as the method to call. Check out Object#send object.send(method_name.to_sym) -- Phillip Hutchings http://www.sitharus.com/