Joined October 2016
·

davidstosik

Lead developer at Kenzai, Inc.
·
Tokyo
·
·
·

If you are using Ruby on Rails or the Facets gem, you can use slice:

original_hash.slice(*keys)

If not, I'd recommend select over reject, for a small readability improvement:

new_hash = original_hash.select { |key, _| keys.include?(key.to_s) }
Achievements
1 Karma
0 Total ProTip Views
Interests & Skills