push all hash keys into array ruby code example
Example 1: ruby merge array of hashes into one hash
a.inject(:merge)
#=> {:a=>:b, :c=>:d}
Example 2: how to add two variables into a hash ruby
your_hash = {}
hash_key = gets.chomp
hash_value = gets.chomp
your_hash[hash_key] = hash_value