Class: Hash
Instance Method Summary collapse
-
#rename_key!(old_key, new_key) ⇒ Object
Renames the specified key to the new value.
Instance Method Details
#rename_key!(old_key, new_key) ⇒ Object
Renames the specified key to the new value
15 16 17 |
# File 'lib/core_extensions.rb', line 15 def rename_key!(old_key, new_key) self[new_key] = self.delete(old_key) end |