Class: Nagios::HostManager
- Inherits:
-
Object
- Object
- Nagios::HostManager
- Defined in:
- lib/rspec/infrastructure/host_manager.rb
Instance Attribute Summary collapse
-
#hosts ⇒ Object
readonly
Returns the value of attribute hosts.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ HostManager
constructor
A new instance of HostManager.
- #manage(hostname) ⇒ Object
Constructor Details
#initialize ⇒ HostManager
Returns a new instance of HostManager.
11 12 13 |
# File 'lib/rspec/infrastructure/host_manager.rb', line 11 def initialize @hosts = {} end |
Instance Attribute Details
#hosts ⇒ Object (readonly)
Returns the value of attribute hosts.
9 10 11 |
# File 'lib/rspec/infrastructure/host_manager.rb', line 9 def hosts @hosts end |
Class Method Details
.hostnames_for_roles(environment, roles) ⇒ Object
19 20 21 22 23 |
# File 'lib/rspec/infrastructure/host_manager.rb', line 19 def self.hostnames_for_roles environment, roles [ *roles ].map do |role| $hosts[environment][role] end.flatten end |