• Wincent
    Open
  • Blog
  • Wiki
  • Snippets
  • Tags
  • Search

Ruby heredocsEdit

Created 9/8/2011, updated 7/9/2021

Basic

<<HERE
Hi, #{foo}
HERE

Optionally indented end-marker

<<-HERE
Hi, #{foo}
    HERE

Non-interpolating

<<'HERE'
#{foo} won't be interpolated
HERE
  • ruby
  • wiki
Site
  • About
  • Blog
  • Wiki
  • Snippets
  • Tags
  • Search
External
  • GitHub
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
Colophon

Made by Greg Hurrell using React, Relay and GraphQL (with help from Git, Redis and Neovim).