transform keys ruby code example
Example: ruby hash transform keys
hash = { name: 'Rob', age: '28' }
hash.transform_keys{ |key| key.to_s.upcase }
# => { "NAME" => "Rob", "AGE" => "28" }
hash = { name: 'Rob', age: '28' }
hash.transform_keys{ |key| key.to_s.upcase }
# => { "NAME" => "Rob", "AGE" => "28" }