Class: Upcheck::Adapters::Statuspage
- Inherits:
-
Object
- Object
- Upcheck::Adapters::Statuspage
- Defined in:
- lib/upcheck/adapters/statuspage.rb
Instance Method Summary collapse
- #components ⇒ Object
- #description ⇒ Object
- #incidents ⇒ Object
-
#initialize(base_url, http_client: HTTPClient.new) ⇒ Statuspage
constructor
A new instance of Statuspage.
- #scheduled_maintenances ⇒ Object
- #status ⇒ Object
Constructor Details
#initialize(base_url, http_client: HTTPClient.new) ⇒ Statuspage
Returns a new instance of Statuspage.
6 7 8 9 |
# File 'lib/upcheck/adapters/statuspage.rb', line 6 def initialize(base_url, http_client: HTTPClient.new) @base_url = base_url.to_s.delete_suffix("/") @http_client = http_client end |
Instance Method Details
#components ⇒ Object
14 15 16 |
# File 'lib/upcheck/adapters/statuspage.rb', line 14 def components @components ||= Component.build_all(http_get("components.json")["components"]) end |
#description ⇒ Object
12 |
# File 'lib/upcheck/adapters/statuspage.rb', line 12 def description = status_payload.fetch("description") |
#incidents ⇒ Object
18 19 20 |
# File 'lib/upcheck/adapters/statuspage.rb', line 18 def incidents @incidents ||= fetch_incidents("incidents/unresolved.json", "incidents") end |
#scheduled_maintenances ⇒ Object
22 23 24 |
# File 'lib/upcheck/adapters/statuspage.rb', line 22 def scheduled_maintenances @scheduled_maintenances ||= fetch_incidents("scheduled-maintenances/active.json", "scheduled_maintenances") end |
#status ⇒ Object
11 |
# File 'lib/upcheck/adapters/statuspage.rb', line 11 def status = status_payload.fetch("indicator") |