Module: Livestatus::State
Instance Method Summary collapse
Instance Method Details
#state ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/livestatus/models.rb', line 49 def state { 0 => :ok, 1 => :warning, 2 => :critical, 3 => :unknown, }[data[:state]] end |
#state_class ⇒ Object
58 59 60 61 62 63 64 65 66 |
# File 'lib/livestatus/models.rb', line 58 def state_class { :ok => :green, :warning => :yellow, :critical => :red, :unknown => :orange, :pending => :gray, }[state] end |
#state_type ⇒ Object
68 69 70 71 72 73 |
# File 'lib/livestatus/models.rb', line 68 def state_type { 0 => :soft, 1 => :hard, }[data[:state_type]] end |