basics/heredoc_parens.rb

tests/_examples/basics/heredoc_parens.rb in the metorex repository.

# Heredoc examples (method calls with parens)
text = <<~HEREDOC
  Hello, World!
  This is a heredoc.
HEREDOC
puts(text)

greeting = <<~MSG
  Good morning!
MSG
puts(greeting.strip)

Output:

Hello, World!
This is a heredoc.
Good morning!