Skip to content

Instantly share code, notes, and snippets.

@tcnksm
Created October 31, 2013 03:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tcnksm/7243933 to your computer and use it in GitHub Desktop.
Save tcnksm/7243933 to your computer and use it in GitHub Desktop.
The sum of hash values by proc
hash = {a: 23, b: 24, c: 25}
puts hash.values.inject(&:+) == (23+24+25) # >> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment