Class: Nagios::API::State
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
- #for_host(hostname) ⇒ Object
-
#initialize(args = {}) ⇒ State
constructor
A new instance of State.
- #reload ⇒ Object
Methods inherited from Resource
Constructor Details
#initialize(args = {}) ⇒ State
Returns a new instance of State.
3 4 5 6 7 |
# File 'lib/nagios/api/state.rb', line 3 def initialize(args = {}) super reload end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Nagios::API::Resource
Instance Method Details
#for_host(hostname) ⇒ Object
13 14 15 |
# File 'lib/nagios/api/state.rb', line 13 def for_host(hostname) data[hostname] end |
#reload ⇒ Object
9 10 11 |
# File 'lib/nagios/api/state.rb', line 9 def reload self.attributes = { :data => api_client.api.query("/state") } end |