Mapping hash keys and values is tricky in Ruby. Mapping a hash returns an array, but we want a hash. Why bother coercing it every time?
To simplify that a bit, AS introduced Hash#transform_keys. I have noticed Rails source base still uses a few tricks to map values of hashes in different places. Additionally, applications built on top of Rails might experience the need to map hash values as well.
That said, I propose to extend Hash to allow this, in manner similar to #transform_keys:
{ a: 1, b: 2 }.transform_keys { |key| :"_#{key}" } # => { :_a => 1, :_b => 2 }
{ a: 1, b: 2 }.transform_values { |val| val ** 2 } # => { :a => 1, :b => 4 }
Yay or nay?