HERE documents give you a shortcut for printing multiple lines to the console window : Here Document « String « Ruby






HERE documents give you a shortcut for printing multiple lines to the console window


# Ruby treats any text that starts with <<TOKEN (where TOKEN can be any uppercase word) as 
# the beginning of a multi-line sequence, and assumes that that text ends with TOKEN. 

print <<HERE
Now
is
the
time
HERE

 








Related examples in the same category

1.Here Documents by number marker
2.Use EOF as the marker for a here document