Answers for "transform_values ruby hash"

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