Skip to content

Instantly share code, notes, and snippets.

@drbrain
Last active July 25, 2017 17:40
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drbrain/e4ab170a9ac31d88f3ab to your computer and use it in GitHub Desktop.
Save drbrain/e4ab170a9ac31d88f3ab to your computer and use it in GitHub Desktop.
A method that has a default argument that defines a method that contains a here-document
def a l = def b; <<-NIGHTMARES; end; puts send l; end
😱😱😱
NIGHTMARES
a
$ ruby nightmares.rb
😱😱😱
@IdahoEv
Copy link

IdahoEv commented Oct 7, 2015

I'd forgotten, btw, that def returns a value. Thanks for the reminder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment