Skip to content

Instantly share code, notes, and snippets.

@BenBrostoff
Created April 27, 2014 17:49
Show Gist options
  • Save BenBrostoff/11351423 to your computer and use it in GitHub Desktop.
Save BenBrostoff/11351423 to your computer and use it in GitHub Desktop.
Hash example with map
hashEx = { :brothers => 8, :sisters => 5, :mom => 1, :dad => 1 }
hashEx.map { |k, v| [k, v+3] }.class # Array
hashEx.map { |k, v| [k, v+3] } # [[:sisters, 8], [:dad, 4], [:brothers, 11], [:mom, 4]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment