Class: Nagira::HostService
- Inherits:
-
Object
- Object
- Nagira::HostService
- Defined in:
- lib/nagira/hostservice.rb
Instance Attribute Summary collapse
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
-
#servicename ⇒ Object
readonly
Returns the value of attribute servicename.
Instance Method Summary collapse
- #current_state ⇒ Object
-
#initialize(hostname, servicename) ⇒ HostService
constructor
A new instance of HostService.
- #state ⇒ Object
- #status ⇒ Object (also: #full)
Constructor Details
#initialize(hostname, servicename) ⇒ HostService
Returns a new instance of HostService.
4 5 6 7 |
# File 'lib/nagira/hostservice.rb', line 4 def initialize(hostname,servicename) @hostname = hostname @servicename = servicename end |
Instance Attribute Details
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname.
8 9 10 |
# File 'lib/nagira/hostservice.rb', line 8 def hostname @hostname end |
#servicename ⇒ Object (readonly)
Returns the value of attribute servicename.
8 9 10 |
# File 'lib/nagira/hostservice.rb', line 8 def servicename @servicename end |
Instance Method Details
#current_state ⇒ Object
25 26 27 |
# File 'lib/nagira/hostservice.rb', line 25 def current_state status.slice('current_state') end |
#state ⇒ Object
21 22 23 |
# File 'lib/nagira/hostservice.rb', line 21 def state status.slice('host_name', 'service_description', 'current_state') end |
#status ⇒ Object Also known as: full
10 11 12 13 14 15 16 17 |
# File 'lib/nagira/hostservice.rb', line 10 def status begin Parser .status['hosts'][hostname]['servicestatus'][servicename] rescue NoMethodError { } end end |