Class: Clustr::ClusterCollection

Inherits:
Hash
  • Object
show all
Defined in:
lib/clustr/cluster_collection.rb

Overview

Note:

The key for each cluster is its name, ie. “rabbitmq”

Represents a collection of the current Cluster configurations. This class can handle initializing clusters that have been defined through Clustr::Config::Clusters.

Instance Method Summary collapse

Constructor Details

#initialize(configurations = {}) ⇒ ClusterCollection

Initializes a collection of Clustr::Cluster instances, by looping through the configurations that have been passed in.

Examples:

Initializing a ClusterCollection

config = {
  "rabbitmq" => {
    "adapter" => "SimpleDB",
    "key" => "my-simpledb-domain"
  }
}
clusters = ClusterCollection.new(config)


22
23
24
25
26
# File 'lib/clustr/cluster_collection.rb', line 22

def initialize(configurations = {})
  configurations.each do |name, config|
    self[name] = Clustr::Cluster.new(name, config)
  end
end