class Honeybadger::Api::Outage

Attributes

created_at[R]
down_at[R]
headers[R]
reason[R]
status[R]
up_at[R]

Public Class Methods

all(project_id, site_id) click to toggle source

Public: Find all outages for a given project and site.

# File lib/honeybadger-api/outage.rb, line 22
def self.all(project_id, site_id)
  path = "projects/#{project_id}/sites/#{site_id}/outages"
  Honeybadger::Api::Request.all(path, handler)
end
handler() click to toggle source

Internal: The handler used to build objects from API responses.

# File lib/honeybadger-api/outage.rb, line 34
def self.handler
  Proc.new { |response| Outage.new(response) }
end
new(opts) click to toggle source

Public: Build a new instance of Outage

opts - A Hash of attributes to initialize an Outage

Returns a new Outage

# File lib/honeybadger-api/outage.rb, line 12
def initialize(opts)
  @down_at = opts[:down_at].nil? ? nil : DateTime.parse(opts[:down_at])
  @up_at = opts[:up_at].nil? ? nil : DateTime.parse(opts[:up_at])
  @created_at = opts[:created_at].nil? ? nil : DateTime.parse(opts[:created_at])
  @status = opts[:status]
  @reason = opts[:reason]
  @headers = opts[:headers]
end
paginate(project_id, site_id, filters = {}) click to toggle source

Public: Paginate all outages for a given project and site.

# File lib/honeybadger-api/outage.rb, line 28
def self.paginate(project_id, site_id, filters = {})
  path = "projects/#{project_id}/sites/#{site_id}/outages"
  Honeybadger::Api::Request.paginate(path, handler, filters)
end