Class: Hash

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

Instance Method Summary collapse

Instance Method Details

#stringify_keysObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/hash.rb', line 4

def stringify_keys
  h = self.map do |k,v|
    v_str = if v.instance_of? Hash
              v.stringify_keys
            else
              v
            end

    [k.to_s, v_str]
  end
  Hash[h]
end