Skip to content

Instantly share code, notes, and snippets.

@eqdw
Created October 7, 2013 21:20
Show Gist options
  • Save eqdw/6875151 to your computer and use it in GitHub Desktop.
Save eqdw/6875151 to your computer and use it in GitHub Desktop.
array.reduce({}) do |hash, elem|
hash[elem.foo] = elem.bar
hash
end
array.reduce({}) do |hash, elem|
hash[elem.foo] = elem.bar
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment