Class: Hash

Inherits:
Object show all
Defined in:
lib/core_extensions.rb

Instance Method Summary collapse

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