class Pingdom::TMSSummary::Outage

summary.outage {“states”=>[

{"actual_timefrom"=>1500000005,"revision"=>12345,"status"=>"up",
 "timefrom"=>0,"timeto"=>1500005000}

]}

Public Class Methods

parse(client, response) click to toggle source
Calls superclass method Pingdom::Base::parse
# File lib/pingdom/tms_summary/outage.rb, line 9
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

actual_timefrom() click to toggle source
# File lib/pingdom/tms_summary/outage.rb, line 28
def actual_timefrom
  Time.at(@attributes["actual_timefrom"])
end
downtime() click to toggle source
# File lib/pingdom/tms_summary/outage.rb, line 16
def downtime
  (@attributes["timeto"] - @attributes["timefrom"]).seconds
end
timefrom() click to toggle source
# File lib/pingdom/tms_summary/outage.rb, line 20
def timefrom
  Time.at(@attributes["timefrom"])
end
timeto() click to toggle source
# File lib/pingdom/tms_summary/outage.rb, line 24
def timeto
  Time.at(@attributes["timeto"])
end