Class: Upcheck::Provider
- Inherits:
-
Object
- Object
- Upcheck::Provider
- Defined in:
- lib/upcheck/provider.rb
Constant Summary collapse
- INDICATOR_NONE =
"none"- INDICATOR_MINOR =
"minor"- INDICATOR_MAJOR =
"major"- INDICATOR_CRITICAL =
"critical"- INDICATOR_MAINTENANCE =
"maintenance"
Instance Method Summary collapse
- #component(name) ⇒ Object
- #components ⇒ Object
- #degraded? ⇒ Boolean
- #description ⇒ Object
- #incidents ⇒ Object
-
#initialize(adapter) ⇒ Provider
constructor
A new instance of Provider.
- #maintenance? ⇒ Boolean
- #major_outage? ⇒ Boolean
- #operational? ⇒ Boolean
- #scheduled_maintenances ⇒ Object
- #status ⇒ Object
Constructor Details
#initialize(adapter) ⇒ Provider
Returns a new instance of Provider.
11 12 13 |
# File 'lib/upcheck/provider.rb', line 11 def initialize(adapter) @adapter = adapter end |
Instance Method Details
#component(name) ⇒ Object
25 |
# File 'lib/upcheck/provider.rb', line 25 def component(name) = components.find { |component| component.name == name } |
#components ⇒ Object
17 |
# File 'lib/upcheck/provider.rb', line 17 def components = adapter.components |
#degraded? ⇒ Boolean
22 |
# File 'lib/upcheck/provider.rb', line 22 def degraded? = status == INDICATOR_MINOR |
#description ⇒ Object
16 |
# File 'lib/upcheck/provider.rb', line 16 def description = adapter.description |
#incidents ⇒ Object
18 |
# File 'lib/upcheck/provider.rb', line 18 def incidents = adapter.incidents |
#maintenance? ⇒ Boolean
24 |
# File 'lib/upcheck/provider.rb', line 24 def maintenance? = status == INDICATOR_MAINTENANCE |
#major_outage? ⇒ Boolean
23 |
# File 'lib/upcheck/provider.rb', line 23 def major_outage? = status == INDICATOR_MAJOR || status == INDICATOR_CRITICAL |
#operational? ⇒ Boolean
21 |
# File 'lib/upcheck/provider.rb', line 21 def operational? = status == INDICATOR_NONE |
#scheduled_maintenances ⇒ Object
19 |
# File 'lib/upcheck/provider.rb', line 19 def scheduled_maintenances = adapter.scheduled_maintenances |
#status ⇒ Object
15 |
# File 'lib/upcheck/provider.rb', line 15 def status = adapter.status |