What does "<<-" mean in Ruby?

It's called heredoc. An easy way to define multiline strings which may include single or double quotes without needing to escape them.

See more here, for example.

Often you use heredocs to define large chunks of code. Some editors know about this and can highlight syntax for you there (if you specify language). Look:

strings vs heredocs


Looks to me like heredoc. The - allows the ending delimiter to ignore whitespace before it.

A simple Google Search gave me this.


There is also a newer HEREDOC syntax for Ruby <<~END that more closely resembles what you would typically see in most shells and other languages with the ~ instead of the - to tell Ruby to strip the leading whitespace to match the least indented line in the block.

https://infinum.co/the-capsized-eight/multiline-strings-ruby-2-3-0-the-squiggly-heredoc