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