Class: Upcheck::Provider

Inherits:
Object
  • Object
show all
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

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 }

#componentsObject



17
# File 'lib/upcheck/provider.rb', line 17

def components = adapter.components

#degraded?Boolean

Returns:

  • (Boolean)


22
# File 'lib/upcheck/provider.rb', line 22

def degraded? = status == INDICATOR_MINOR

#descriptionObject



16
# File 'lib/upcheck/provider.rb', line 16

def description = adapter.description

#incidentsObject



18
# File 'lib/upcheck/provider.rb', line 18

def incidents = adapter.incidents

#maintenance?Boolean

Returns:

  • (Boolean)


24
# File 'lib/upcheck/provider.rb', line 24

def maintenance? = status == INDICATOR_MAINTENANCE

#major_outage?Boolean

Returns:

  • (Boolean)


23
# File 'lib/upcheck/provider.rb', line 23

def major_outage? = status == INDICATOR_MAJOR || status == INDICATOR_CRITICAL

#operational?Boolean

Returns:

  • (Boolean)


21
# File 'lib/upcheck/provider.rb', line 21

def operational? = status == INDICATOR_NONE

#scheduled_maintenancesObject



19
# File 'lib/upcheck/provider.rb', line 19

def scheduled_maintenances = adapter.scheduled_maintenances

#statusObject



15
# File 'lib/upcheck/provider.rb', line 15

def status = adapter.status