Class: Nagios::API::State
Instance Attribute Summary
Attributes inherited from Resource
#api_client, #attributes
Instance Method Summary
collapse
Methods inherited from Resource
#method_missing, #to_hash
Constructor Details
#initialize(args = {}) ⇒ 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
|