rails hash of hash map key value change value code example
Example 1: change key value hash ruby
toto[:key] = "newvalue"
Example 2: ruby map hash
hash = { bacon: "protein", apple: "fruit" }
hash.map { |k,v| [k, v.to_sym] }.to_h
# {:bacon=>:protein, :apple=>:fruit}