Class: Hash

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

Direct Known Subclasses

DeepMergeHash

Instance Method Summary collapse

Instance Method Details

#to_snake_keys(value = self) ⇒ Object



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

def to_snake_keys(value = self)
  case value
  when Array
    value.map { |v| to_snake_keys(v) }
  when Hash
    snake_hash(value)
  else
    value
  end
end