You’ll be hard pressed to escape working with hashes in Ruby, but don’t make
using them a painful experience. Here are some helpful tips that I’ve collected
that I would like to share.
slice over a helper method
I see this more often then I care to remember:
Hash has this built in and performs the same as above.
churning values out into an array
[hash[:key], hash[:key2], hash[:key3]]
values_at will perform this with a little less mess.
hash.keys(:key, :key2, :key3)
merge can be a big help
Instead, maybe this: