I dont understand how #{…} construct is used in Ruby.
I’ve seen in used in the regexp example on http://www.ruby-doc.org/core-1.9.3/Regexp.html
place = "tokyo"
/#{place}/.match("Go to tokyo")
#=> #<MatchData "tokyo">
What exactly is this #{…} feature called and does anyone know of some good working examples of this.
Really appreciate the help.
Thanks!
Is called interpolation, and allows you to convert placeholders to the value they represent…
http://kconrails.com/2010/12/08/ruby-string-interpolation/