Method: Hash#transform_keys!
- Defined in:
- lib/active_support/core_ext/hash/keys.rb
#transform_keys! ⇒ Object
Destructively converts all keys using the block
operations. Same as transform_keys
but modifies self
.
23 24 25 26 27 28 29 |
# File 'lib/active_support/core_ext/hash/keys.rb', line 23 def transform_keys! return enum_for(:transform_keys!) { size } unless block_given? keys.each do |key| self[yield(key)] = delete(key) end self end |