From: Guby Date: 2008-02-29T21:21:48+09:00 Subject: Re: String interpolation method? Not that it is a lot nicer, but just another solution... and a little bit on side of what you wanted, but: >> a = lambda{|c| "bra#{c}ket"} >> a.call(" see ") => "bra see ket" :) On Feb 28, 2008, at 12:42 AM, John Carter wrote: > On Thu, 28 Feb 2008, Trans wrote: > > >> => require 'facets/string/interpolate' > > Hmm.... > > Very neat in application.... > >>>> String.interpolate{a} > > but.... > > def interpolate(&str) > eval "%{#{str.call}}", str.binding > end > > ...equally nasty in implementation. > > Ah well, clearly then I wasn't missing something.... there is no > standard method. > > Thanks, > > > John Carter Phone : (64)(3) 358 6639 > Tait Electronics F