Class: URLCanonicalize::HTTP

Inherits:
Object
  • Object
show all
Defined in:
lib/url_canonicalize/http.rb

Overview

Persistent connection for possible repeated requests to the same host

Instance Method Summary collapse

Instance Method Details

#fetchObject



4
5
6
# File 'lib/url_canonicalize/http.rb', line 4

def fetch
  loop { break last_known_good if handle_response }
end

#request(http_request) ⇒ Object



17
18
19
# File 'lib/url_canonicalize/http.rb', line 17

def request(http_request)
  http.request http_request
end

#uriObject



8
9
10
# File 'lib/url_canonicalize/http.rb', line 8

def uri
  @uri ||= URLCanonicalize::URI.parse(url) # Malformed URLs will raise a URLCanonicalize exception
end

#url=(value) ⇒ Object



12
13
14
15
# File 'lib/url_canonicalize/http.rb', line 12

def url=(value)
  @url = value.to_s
  @uri = nil
end