Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Hash#transform_keys!

hash.transform_keys! {|key| ... } → self
hash.transform_keys!(hash2) → self
hash.transform_keys!(hash2) {|other_key| ...} → self
hash.transform_keys! → new_enumerator

Same as Hash#transform_keys but modifies the receiver in place instead of returning a new hash.

Ruby version changes

  1. 3.0