In this code:
arr = [ { id: 1, body: 'foo'}, { id: 2, body: 'bar' }, { id: 3, body: 'foobar' }]
arr.map { |h| h[:id] } # => [1, 2, 3]
Is there a cleaner way to get the values out of an array of hashes like this?
Underscore.js has pluck, I'm wondering if there is a Ruby equivalent.