The <<- operator on Ruby, where is it documented?

Viewed 8242

I recently used the <<- operator to output a multi-line string, like this:

<<-form
  <h1>Name to say hi!</h1>
  <form method="post">
    <input type="text" name="name">
    <input type="submit" value="send">
  </form>
form

But I stole the <<- operator from some Open Source code, but I didn't find any documentation on it.

I kinda figured out that it works the same as in bash:

$ cat <<EOF >> form.html
> <h1>Name to say hi!</h1>
> <form method="post">
>   <input type="text" name="name">
>   <input type="submit" value="send">
> </form>
> EOF

Does it work that way? I just wanna find documentation on it.

5 Answers
Related