Class: EssCee::Host
- Inherits:
-
Object
- Object
- EssCee::Host
- Defined in:
- lib/host.rb
Instance Attribute Summary collapse
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
Instance Method Summary collapse
-
#initialize(hostname) ⇒ Host
constructor
A new instance of Host.
- #service(name) ⇒ Object
- #services ⇒ Object
Constructor Details
#initialize(hostname) ⇒ Host
Returns a new instance of Host.
5 6 7 |
# File 'lib/host.rb', line 5 def initialize(hostname) @hostname = hostname end |
Instance Attribute Details
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname.
3 4 5 |
# File 'lib/host.rb', line 3 def hostname @hostname end |
Instance Method Details
#service(name) ⇒ Object
14 15 16 |
# File 'lib/host.rb', line 14 def service(name) services.find {|service| service.name == name} end |
#services ⇒ Object
9 10 11 12 |
# File 'lib/host.rb', line 9 def services responses = ResponseParser.get_services(%x[sc \\\\#{@hostname} query state= all]) responses.map { |service| EssCee::Service.new(@hostname, service) } end |