def deep_transform_keys!(object, &block)
      case object
      when Hash
        object.keys.each do |key|
          value = object.delete(key)
          object[yield(key)] = deep_transform_keys!(value) { |key| yield(key) }
        end
        object
      when Array
        object.map! { |e| deep_transform_keys!(e) { |key| yield(key) } }
      else
        object
      end
    end
def deep_transform_keys!(object, &block)
      case object
      when Hash
        object.keys.each do |key|
          value = object.delete(key)
          object[yield(key)] = deep_transform_keys!(value) { |key| yield(key) }
        end
        object
      when Array
        object.map! { |e| deep_transform_keys!(e) { |key| yield(key) } }
      else
        object
      end
    end
Inspired by ActiveSupport's implementation