class ActionController::Parameters

def each_pair(&block)

the same way as Hash#each_pair
Convert all hashes in values into parameters, then yield each pair in
def each_pair(&block)
  @parameters.each_pair do |key, value|
    yield key, convert_hashes_to_parameters(key, value)
  end
end