Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/hash_extensions.rb

Overview

I need to stringify keys, but I don’t want to include the whole Rails framework, so I’m going extend Hash myself.

Instance Method Summary collapse

Instance Method Details

#stringify_keys!Object



3
4
5
6
7
8
# File 'lib/hash_extensions.rb', line 3

def stringify_keys!
  keys.each do |key|
    self[key.to_s] = delete(key)
  end
  self
end