On Tue, Dec 7, 2010 at 1:11 PM, Fritz Trapper <ajfrenzel / web.de> wrote:
> Suppose the following code:
>
> t='#{a} + #{b}'
> ...
> a='a';b='b'
>
> How to cause ruby to interpret t as a "string" to get the result string
> "a + b"?

Turn it into a function of some kind:

def f(x,y)
  "#{x} + #{y}"
end

x = f("a", "b")

or

f = lambda {|x,y| "#{x} + #{y}"}
x = f["a", "b"]

Kind regards

robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/