transform_keys()
Instance Public methods
Returns a new hash with all keys converted using the block operation.
1 2 3 4 | hash = { name: 'Rob' , age: '28' } hash.transform_keys{ |key| key.to_s.upcase } # => {"NAME"=>"Rob", "AGE"=>"28"} |
Please login to continue.