class Pingdom::SummaryAverage
Attributes
probe_responses[RW]
responsetime[RW]
Public Class Methods
collection_type()
click to toggle source
# File lib/pingdom/summary_average.rb, line 15 def collection_type 'summary' end
path()
click to toggle source
# File lib/pingdom/summary_average.rb, line 11 def path '/summary.average' end
permit()
click to toggle source
# File lib/pingdom/summary_average.rb, line 19 def permit { to: :valid_time?, from: :valid_time?, probes: :valid_int_list?, includeuptime: :valid_boolean?, bycountry: :valid_boolean?, byprobe: :valid_boolean? } end
Public Instance Methods
avgresponse()
click to toggle source
# File lib/pingdom/summary_average.rb, line 34 def avgresponse data = responsetime['avgresponse'] data.map! do |v| Struct::AvgResponse.new(v['countryiso'], v['avgresponse']) end if data.is_a?(Array) data end
from()
click to toggle source
# File lib/pingdom/summary_average.rb, line 59 def from Time.at responsetime['from'] end
status()
click to toggle source
# File lib/pingdom/summary_average.rb, line 47 def status @status end
status=(v)
click to toggle source
# File lib/pingdom/summary_average.rb, line 43 def status= v @status=Struct::AverageStatus.new(v['totalup'],v['totaldown'],v['totalunknown']) end
to()
click to toggle source
# File lib/pingdom/summary_average.rb, line 63 def to Time.at responsetime['to'] end