hash = { foo: 1, bar: 2 } # sum up all values of the hash # start with 0 # / result = hash.inject(0) { |sum, key_value| sum + key_value.last } #=> 3
my_hash.values_at("key1", "key2") #=> ["value1", "value2"]
my_hash["key"] #=> "value"