K
Kevin Olbrich
I'm sure the answer to this will seem simple once I see it. Right now
it eludes me.
How can one have a string object like this...
a = '#{some_value}'
and have it get evaluated as a double quoted string (with the value for
some_value being automatically replaced) at a later time?
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"
_Kevin
it eludes me.
How can one have a string object like this...
a = '#{some_value}'
and have it get evaluated as a double quoted string (with the value for
some_value being automatically replaced) at a later time?
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"
_Kevin