Class: Nagira::ResourceStatusController
- Inherits:
-
Object
- Object
- Nagira::ResourceStatusController
- Includes:
- HostStatusNameConcerneable, OutputTypeable
- Defined in:
- app/controllers/resource_status_controler.rb
Instance Attribute Summary
Attributes included from HostStatusNameConcerneable
#hostname, #resource, #service_name
Instance Method Summary collapse
-
#get ⇒ Object
Return status of the resource.
-
#initialize(nagios_status, output: nil, hostname: nil, service_name: nil, resource: "servicestatus") ⇒ ResourceStatusController
constructor
A new instance of ResourceStatusController.
Methods included from HostStatusNameConcerneable
Methods included from OutputTypeable
#body_with_list, #full?, #list?, #state?
Constructor Details
#initialize(nagios_status, output: nil, hostname: nil, service_name: nil, resource: "servicestatus") ⇒ ResourceStatusController
Returns a new instance of ResourceStatusController.
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/resource_status_controler.rb', line 13 def initialize(nagios_status, output: nil, hostname: nil, service_name: nil, resource: "servicestatus") @nagios_status = nagios_status @output = output @hostname = hostname @service_name = service_name @resource = if resource == 'services' "servicestatus" else resource end end |
Instance Method Details
#get ⇒ Object
Return status of the resource
27 28 29 30 31 32 33 34 |
# File 'app/controllers/resource_status_controler.rb', line 27 def get case when state?; then slice when list?; then list else with_service_name end end |