Class: Pingdom::Result

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

Overview

“probeid”=>28, “responsetime”=>221, “statusdesc”=>“OK”, “status”=>“up”, “probedesc”=>“Amsterdam 2, Netherlands”

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/result.rb', line 4

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

Instance Method Details

#probeObject



14
15
16
# File 'lib/pingdom/result.rb', line 14

def probe
  @client.probes.detect { |probe| probe.id == probe_id }
end