Class: NagiosAnalyzer::SectionDecorator
- Inherits:
-
Object
- Object
- NagiosAnalyzer::SectionDecorator
- Defined in:
- lib/nagios_analyzer/section_decorator.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
- #current_state ⇒ Object
- #flags_short ⇒ Object
-
#initialize(section) ⇒ SectionDecorator
constructor
A new instance of SectionDecorator.
Constructor Details
#initialize(section) ⇒ SectionDecorator
Returns a new instance of SectionDecorator.
18 19 20 |
# File 'lib/nagios_analyzer/section_decorator.rb', line 18 def initialize(section) @object = section end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
16 17 18 |
# File 'lib/nagios_analyzer/section_decorator.rb', line 16 def object @object end |
Instance Method Details
#current_state ⇒ Object
22 23 24 25 26 |
# File 'lib/nagios_analyzer/section_decorator.rb', line 22 def current_state if object.current_state Status::STATES[object.current_state] end end |
#flags_short ⇒ Object
28 29 30 31 32 33 |
# File 'lib/nagios_analyzer/section_decorator.rb', line 28 def flags_short ret = [] ret.push (object.active_checks_enabled == 1) ? "AC": "ac" ret.push (object.notifications_enabled == 1) ? "NT": "nt" ret.join(",") end |