Class: Pingdom::Check

Inherits:
Base
  • Object
show all
Defined in:
lib/pingdom/check.rb

Overview

“id”=>259103, “type”=>“http”, “lastresponsetime”=>203173, “status”=>“up”, “lasttesttime”=>1298102416

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

attributes, check_error!, #id, #initialize, #inspect, #method_missing, #respond_to?, #respond_to_missing?

Constructor Details

This class inherits a constructor from Pingdom::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Pingdom::Base

Class Method Details

.parse(client, response) ⇒ Object



4
5
6
7
8
9
# File 'lib/pingdom/check.rb', line 4

def self.parse(client, response)
  checks = super
  Array.wrap(checks["checks"] || checks["check"]).map do |check|
    new(client, response, check)
  end
end

Instance Method Details

#lasterrortimeObject



27
28
29
# File 'lib/pingdom/check.rb', line 27

def lasterrortime
  Time.at(super)
end

#lasttesttimeObject



23
24
25
# File 'lib/pingdom/check.rb', line 23

def lasttesttime
  Time.at(super)
end

#results(options = {}) ⇒ Object



15
16
17
# File 'lib/pingdom/check.rb', line 15

def results(options = {})
  @client.results(id, options)
end

#summaryObject



19
20
21
# File 'lib/pingdom/check.rb', line 19

def summary
  @client.summary(id)
end