class Hash

Public Instance Methods

camelize_keys!() click to toggle source

Camelize all keys of the hash

@return [Hash] The hash with camelized keys

# File lib/resas_kit/hash_extensions.rb, line 7
def camelize_keys!
  deep_transform_keys! do |key|
    key.to_s
      .split(/(_*\d+_*)/)
      .reject(&:empty?)
      .map { |k| k.camelize(:lower) }
      .join
      .to_sym
  end

  self
end