class Updown::Downtime
Attributes
duration[RW]
ended_at[RW]
error[RW]
started_at[RW]
Public Class Methods
find(token, page: 1)
click to toggle source
# File lib/updown/downtime.rb, line 5 def self.find(token, page: 1) Updown::Call.downtimes(token, page: page).map do |downtime| Downtime.new downtime end end
new(json)
click to toggle source
# File lib/updown/downtime.rb, line 11 def initialize(json) @error = json['error'] @started_at = Time.parse(json['started_at']) if json['started_at'] @ended_at = Time.parse(json['ended_at']) if json['ended_at'] @duration = json['duration'] end