method

_deep_transform_keys_in_object!

Importance_0
v7.0.0 - Show latest stable - 0 notes - Class: Hash
_deep_transform_keys_in_object!(object, &block) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activesupport/lib/active_support/core_ext/hash/keys.rb, line 129
    def _deep_transform_keys_in_object!(object, &block)
      case object
      when Hash
        object.keys.each do |key|
          value = object.delete(key)
          object[yield(key)] = _deep_transform_keys_in_object!(value, &block)
        end
        object
      when Array
        object.map! { |e| _deep_transform_keys_in_object!(e, &block) }
      else
        object
      end
    end
Register or log in to add new notes.