Class: Diaspora::Cluster::Creator::NodeCollectionFactory
- Inherits:
-
Object
- Object
- Diaspora::Cluster::Creator::NodeCollectionFactory
- Extended by:
- DependencyInjector
- Defined in:
- lib/diaspora-cluster-creator/node_collection_factory.rb
Instance Attribute Summary collapse
-
#cluster ⇒ Object
readonly
Returns the value of attribute cluster.
Instance Method Summary collapse
- #build_from(names) ⇒ Object
-
#initialize(cluster) ⇒ NodeCollectionFactory
constructor
A new instance of NodeCollectionFactory.
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
#cluster ⇒ Object (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 |