Class: Naginata::StatusDecorator
- Inherits:
-
Object
- Object
- Naginata::StatusDecorator
- Defined in:
- lib/naginata/status_decorator.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
- #hosts_table ⇒ Object
-
#initialize(status) ⇒ StatusDecorator
constructor
A new instance of StatusDecorator.
- #services_table ⇒ Object
Constructor Details
#initialize(status) ⇒ StatusDecorator
Returns a new instance of StatusDecorator.
8 9 10 |
# File 'lib/naginata/status_decorator.rb', line 8 def initialize(status) @object = status end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
6 7 8 |
# File 'lib/naginata/status_decorator.rb', line 6 def object @object end |
Instance Method Details
#hosts_table ⇒ Object
12 13 14 15 16 |
# File 'lib/naginata/status_decorator.rb', line 12 def hosts_table object.host_items.sort.map do |section| [object.nagios, section.host_name, section.decorate.current_state, section.decorate.flags_short, section.plugin_output] end end |
#services_table ⇒ Object
18 19 20 21 22 |
# File 'lib/naginata/status_decorator.rb', line 18 def services_table object.service_items.sort.map do |section| [object.nagios, section.host_name, section.service_description, section.decorate.current_state, section.decorate.flags_short, section.plugin_output] end end |