Sha256: 0f136994ff643165ce4ac8f595f52c1e22026273af9876ea2fc1a0ff4150f17f

Contents?: true

Size: 485 Bytes

Versions: 4

Compression:

Stored size: 485 Bytes

Contents

module Jets::Util
  module Camelize
    # Not named camelize! because it conflicts with zeitwerk's camelize!
    def camelize(object)
      result = case object
      when Array
        object.map { |o| camelize(o) }
      when Hash
        Jets::Camelizer.transform(object).deep_symbolize_keys
      else
        object
      end

      case object
      when Symbol
        object
      when NilClass
        nil
      else
        object.replace(result)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jets-6.0.5 lib/jets/util/camelize.rb
jets-6.0.4 lib/jets/util/camelize.rb
jets-6.0.3 lib/jets/util/camelize.rb
jets-6.0.2 lib/jets/util/camelize.rb