I was wondering if there was a way to setup a string with interpolation to have the code in the string run multiple times. (I know I could just put the code in a loop, but for the sake of wondering).
For example, I would like the following code:
x = "#{puts 'a'}"
3.times do
x
end
To have the output:
a
a
a
This issue I've found is that interpolation is resolved upon initialization. But is there a way to setup a string so that the interpolation can be reused?