class Patron::Request

def max_redirects=(new_max_redirects)

def max_redirects=(new_max_redirects)
  if new_max_redirects.to_i < -1
    raise ArgumentError, "Max redirects must be a positive integer, 0 or -1"
  end
  @max_redirects = new_max_redirects.to_i
end