Skip to content

Instantly share code, notes, and snippets.

@nickmccurdy
Created January 18, 2013 00:52
Show Gist options
  • Save nickmccurdy/4561362 to your computer and use it in GitHub Desktop.
Save nickmccurdy/4561362 to your computer and use it in GitHub Desktop.
Cramming multiple expressions into one line of Ruby (hacky, useful for code golfing)
[a = 'hello'].each { |_| b = 'world' }
puts a # hello
puts b # world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment