From: Paul McMahon Date: 2008-04-04T10:42:28+09:00 Subject: Re: Using a string as executable code Peter Marks wrote: > I need to store one line method calls as strings in my db and then apply > them to an object. For example, I would store "name.upcase" in the db > and then somehow call person.name.upcase. Any idea how I might pull this > off? Well, you could do result = "name.upcase".split(".").inject(person) do |object, method| object.send(method) end but storing code in a database smells. Perhaps it would be better to find another approach that avoids storing the code in the first place