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