Class: Cryptid::Helpers

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

Class Method Summary collapse

Class Method Details

.camelize(hash) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/cryptid/helpers.rb', line 5

def self.camelize(hash)
  hash.reduce({}) do |h, (k, v)|
    if v.is_a? Hash
      h.merge({k.to_s.camel_lower.to_sym => camelize(v)})
    else
      h.merge({k.to_s.camel_lower.to_sym => v})
    end
  end
end