Method: Adzerk::Util#camelize_data
- Defined in:
- lib/adzerk/util.rb
#camelize_data(data) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/adzerk/util.rb', line 5 def camelize_data(data) return data unless data.respond_to?(:reduce) data.reduce({}) do |acc, (sym, val)| sym = sym.to_s.camelize if sym.class == Symbol acc[sym] = case val when Hash then camelize_data(val) when Array then val.map { |elem| camelize_data(elem) } else val end acc end end |