From: Stefan Rusterholz Date: 2007-08-26T18:38:46+09:00 Subject: Re: String interpolation Thomas Worm wrote: > a = 5 > b = "#{a}" > puts b > > a = 6 > puts b > > Returns: > 5 > 5 > > which is clear to me, why. But is there a way to define such a string > and > interpolate it at a later time? > > Thomas a = 5 b = proc { "a is now: #{a}" } def b.to_s; call; end puts b # !> a is now: 5 a = 6 puts b # !> a is now: 6 Enjoy Regards Stefan -- Posted via http://www.ruby-forum.com/.