class Pingdom::Summary::Outage

summary.outage {“states”=>[{“timeto”=>1297587576, “timefrom”=>1297475316, “status”=>“up”},

{"timeto"=>1297587906, "timefrom"=>1297587576, "status"=>"down"},
{"timeto"=>1298110749, "timefrom"=>1297587906, "status"=>"up"}]}

Public Class Methods

parse(client, response) click to toggle source
Calls superclass method Pingdom::Base::parse
# File lib/pingdom/summary/outage.rb, line 8
def self.parse(client, response)
  super["summary"]["states"].select { |s| s["status"] == "down" }.
    map do |outage|
    new(client, response, outage)
  end
end

Public Instance Methods

downtime() click to toggle source
# File lib/pingdom/summary/outage.rb, line 15
def downtime
  (@attributes["timeto"] - @attributes["timefrom"]).seconds
end
timefrom() click to toggle source
# File lib/pingdom/summary/outage.rb, line 19
def timefrom
  Time.at(@attributes["timefrom"])
end
timeto() click to toggle source
# File lib/pingdom/summary/outage.rb, line 23
def timeto
  Time.at(@attributes["timeto"])
end