Ruby interpolation puts the value of an expression inside a string. In a double-quoted string, write the expression between `#{` and `}`: `"Two plus two is #{2 + 2}."` produces `"Two plus two is 4."`. Ruby evaluates what is inside the braces and inserts the result, rather than displaying the braces. section 2.2.3 section 8.1.1
puts "This ticket is for: #{ticket.event}, at #{ticket.venue}.\n" +
"The performer is #{ticket.performer}.\n" +
"The seat is #{ticket.seat}, " +
"and it costs $#{"%.2f." % ticket.price}"
A ticket-printing example inserts method results where they belong in the output. Interpolation makes the intended layout easier to see and replaces several separate printing calls; `+` joins the remaining string pieces. section 2.2.3
Quotation determines whether interpolation happens. `"#{2 + 2}"` evaluates the expression, but `'#{2 + 2}'` keeps those characters literal. To keep them literal inside double quotes, escape the opening `#` with a backslash. The same single- versus double-quoted distinction applies to the corresponding heredoc forms; `%Q{}` and `%{}` produce double-quoted-style strings. section 8.1.1
When inserted text becomes a regexp pattern
Interpolation also works in a regexp: with `str = "def"`, `/abc#{str}/` becomes `/abcdef/`. Be careful when the inserted string contains regexp syntax. If `str = "a.c"`, `/#{str}/` matches both `"a.c"` and `"abc"`, because the inserted dot acts as a regexp wildcard. Use `/#{Regexp.escape(str)}/` when the string should be matched literally; it matches `"a.c"` but not `"abc"`. section 11.6.1



