Method: Eye::Checker::Http#initialize

Defined in:
lib/eye/checker/http.rb

#initialize(*args) ⇒ Http

Returns a new instance of Http.



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/eye/checker/http.rb', line 18

def initialize(*args)
  super

  @uri = URI.parse(url)
  @proxy_uri = URI.parse(proxy_url) if proxy_url
  @kind = case kind
    when Integer then Net::HTTPResponse::CODE_TO_OBJ[kind.to_s]
    when String, Symbol then Net.const_get("HTTP#{kind.to_s.camelize}") rescue Net::HTTPSuccess
    else Net::HTTPSuccess
  end
  @open_timeout = (open_timeout || 3).to_f
  @read_timeout = (read_timeout || timeout || 15).to_f
end