From: gwtmp01@... Date: 2006-01-18T15:35:16+09:00 Subject: Re: Delayed quote expansion On Jan 18, 2006, at 12:29 AM, Kevin Olbrich wrote: > I would prefer that it is evaluated in context from which it is > called. > > I would like to do something like this... > > def func(param) > test = 42 > puts param.quote_substitution > end > > func('my number is #{test}') #=> "my number is 42" How about: template = lambda { |x| "my number is: #{x}" } # some time passes template.call(42) # "my number is: 42" Gary Wright