Module: Hextech::Mixins::TransformKeys

Included in:
Array, Hash
Defined in:
lib/hextech/mixins/transform_keys.rb

Instance Method Summary collapse

Instance Method Details

#to_symbolized_snake_keys(value = self) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/hextech/mixins/transform_keys.rb', line 6

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