Ruby string interpolation

  1. The bad way:
count = 3.to_s
puts 'I ate ' + count + ' burgers today!'
  1. The lame way:
yuck = 'salad'
puts "No #{yuck} for me please!"
  1. The woke way (notice where the .chomp call goes):
template = <<~TEMPLATE.chomp
  A large steak, %{how_done}, please!
TEMPLATE

puts template % { how_done: 'medium rare' }

For templating, follow this link: