greeting = 'hello'
my_string = "#{greeting} world"
puts my_string

--output:--
hello world


attr = 'color'
my_string =<<ENDOFSTRING
  def #{attr}
    @#{attr}
  end
ENDOFSTRING

puts my_string

--output:--
  def color
    @color
  end

-- 
Posted via http://www.ruby-forum.com/.