Class: Hash

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

Instance Method Summary collapse

Instance Method Details

#camelize_keys(value = self) ⇒ Object



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

def camelize_keys(value = self)
  case value
  when Array
    value.map { |v| camelize_keys(v) }
  when Hash
    value.to_h { |k, v| [camelize_key(k), camelize_keys(v)] }
  else
    value
  end
end