I have a string within a variable that contains a placeholder. So quite literally I have this:
x = "something_\#{environment}"
I want to perform placeholder substitution of x at runtime with a value of environment that isn't available at the point x is defined. I ultimately want to end up with:
y = "something_test"
Is there any way to accomplish this in Ruby?
Edit 1: this isn't solved using eval which is dead. Hence the linked duplicate doesn't address my question.