Class: Poller::HTTP::HttpPoller

Inherits:
Object
  • Object
show all
Includes:
Poller
Defined in:
lib/poller/http/http_poller.rb

Instance Method Summary collapse

Methods included from Poller

#check

Constructor Details

#initialize(url, matcher, timeout_seconds, period_seconds, proxy = nil) ⇒ HttpPoller

Returns a new instance of HttpPoller.



20
21
22
23
24
25
26
# File 'lib/poller/http/http_poller.rb', line 20

def initialize(url, matcher, timeout_seconds, period_seconds, proxy = nil)
  proxy = OpenStruct.new(proxy) if proxy.is_a?(Hash)
  probe = proxy.nil? \
    ? HttpProbe.new(url, matcher) \
    : HttpProbe.new(url, matcher, proxy.hostname, proxy.port, proxy.user, proxy.password)
  super(probe, timeout_seconds, period_seconds, url)
end