Class: Diaspora::Cluster::Creator::NodeCollectionFactory

Inherits:
Object
  • Object
show all
Extended by:
DependencyInjector
Defined in:
lib/diaspora-cluster-creator/node_collection_factory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cluster) ⇒ NodeCollectionFactory

Returns a new instance of NodeCollectionFactory.



14
15
16
# File 'lib/diaspora-cluster-creator/node_collection_factory.rb', line 14

def initialize(cluster)
  @cluster = cluster
end

Instance Attribute Details

#clusterObject (readonly)

Returns the value of attribute cluster.



13
14
15
# File 'lib/diaspora-cluster-creator/node_collection_factory.rb', line 13

def cluster
  @cluster
end

Instance Method Details

#build_from(names) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/diaspora-cluster-creator/node_collection_factory.rb', line 18

def build_from(names)
  collection = []
  names.each_with_object(collection) do |name,mem| 
    mem << node_builder.call(cluster, name)
  end
  node_guarantor.call(collection)
  collection
end