Class: ClusterManagement::Cluster
- Inherits:
-
Object
- Object
- ClusterManagement::Cluster
- Defined in:
- lib/cluster_management/cluster.rb
Defined Under Namespace
Classes: Services
Instance Attribute Summary collapse
-
#boxes ⇒ Object
readonly
Returns the value of attribute boxes.
- #config ⇒ Object
- #logger ⇒ Object
Instance Method Summary collapse
-
#initialize ⇒ Cluster
constructor
A new instance of Cluster.
- #services(&b) ⇒ Object
Constructor Details
#initialize ⇒ Cluster
Returns a new instance of Cluster.
24 25 26 27 28 29 30 31 32 |
# File 'lib/cluster_management/cluster.rb', line 24 def initialize @services = Services.new @boxes = Hash.new do |h, host| box = config.ssh ? Box.new(host.to_s, config.ssh) : Box.new(host.to_s) box.open h[host] = box end end |
Instance Attribute Details
#boxes ⇒ Object (readonly)
Returns the value of attribute boxes.
34 35 36 |
# File 'lib/cluster_management/cluster.rb', line 34 def boxes @boxes end |
#config ⇒ Object
41 |
# File 'lib/cluster_management/cluster.rb', line 41 def config; @config || raise("config not defined!") end |
#logger ⇒ Object
42 |
# File 'lib/cluster_management/cluster.rb', line 42 def logger; @logger || raise("logger not defined!") end |
Instance Method Details
#services(&b) ⇒ Object
36 37 38 |
# File 'lib/cluster_management/cluster.rb', line 36 def services &b b ? @services.instance_eval(&b) : @services end |