I have a ruby variable created from a complex code , But I am unable to replace the variable declared inside my main variable . Here is an example , it may be simple but I could not able to change main variable declaration procedure.
irb(main):065:0> p msg
"My name is \#{name}"
irb(main):066:0> puts name
Foo
irb(main):067:0> puts msg
My name is #{name}
irb(main):068:0> puts "#{msg}"
My name is #{name}
I want an output like "My name is Foo" ; That needs to be achieved considering I can't control content format of variable 'msg'
msga simple String, or is it a custom class?msg. That means you cannot use string interpolation at all. But is there any specification on howmsgwill look like? Like it contains always\#{name}? Or is it possible thatmsgmight have a totally different format (like correct string interpolation) or different variables names (likefullname)?