Answers for "ruby hash transform keys"

0

ruby hash transform keys

hash = { name: 'Rob', age: '28' }

hash.transform_keys{ |key| key.to_s.upcase }
# => { "NAME" => "Rob", "AGE" => "28" }
Posted by: Guest on May-26-2020

Browse Popular Code Answers by Language