Skip to content

Instantly share code, notes, and snippets.

@nickserv
Created January 18, 2013 00:52
Show Gist options
  • Save nickserv/4561362 to your computer and use it in GitHub Desktop.
Save nickserv/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