Class: Diaspora::Cluster::Creator::Cluster
- Inherits:
-
Object
- Object
- Diaspora::Cluster::Creator::Cluster
- Extended by:
- DependencyInjector
- Defined in:
- lib/diaspora-cluster-creator/cluster.rb
Instance Attribute Summary collapse
-
#attribute_names ⇒ Object
readonly
Returns the value of attribute attribute_names.
-
#names ⇒ Object
readonly
Returns the value of attribute names.
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Instance Method Summary collapse
- #attributes ⇒ Object
- #each_attribute ⇒ Object
- #each_edge ⇒ Object
- #each_node ⇒ Object
- #edges ⇒ Object
-
#initialize(names = [], attribute_names = []) ⇒ Cluster
constructor
A new instance of Cluster.
- #nodes ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(names = [], attribute_names = []) ⇒ Cluster
Returns a new instance of Cluster.
19 20 21 22 |
# File 'lib/diaspora-cluster-creator/cluster.rb', line 19 def initialize(names = [], attribute_names = []) @names = names @attribute_names = attribute_names end |
Instance Attribute Details
#attribute_names ⇒ Object (readonly)
Returns the value of attribute attribute_names.
17 18 19 |
# File 'lib/diaspora-cluster-creator/cluster.rb', line 17 def attribute_names @attribute_names end |
#names ⇒ Object (readonly)
Returns the value of attribute names.
15 16 17 |
# File 'lib/diaspora-cluster-creator/cluster.rb', line 15 def names @names end |
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
16 17 18 |
# File 'lib/diaspora-cluster-creator/cluster.rb', line 16 def settings @settings end |
Instance Method Details
#attributes ⇒ Object
44 45 46 |
# File 'lib/diaspora-cluster-creator/cluster.rb', line 44 def attributes @attributes ||= attribute_collection_builder.call end |
#each_attribute ⇒ Object
32 33 34 |
# File 'lib/diaspora-cluster-creator/cluster.rb', line 32 def each_attribute attributes.each { |attribute| yield(attribute) } end |
#each_edge ⇒ Object
28 29 30 |
# File 'lib/diaspora-cluster-creator/cluster.rb', line 28 def each_edge edges.each { |edge| yield(edge) } end |
#each_node ⇒ Object
24 25 26 |
# File 'lib/diaspora-cluster-creator/cluster.rb', line 24 def each_node nodes.each { |node| yield(node) } end |
#edges ⇒ Object
40 41 42 |
# File 'lib/diaspora-cluster-creator/cluster.rb', line 40 def edges @edges ||= edge_collection_builder.call end |
#nodes ⇒ Object
36 37 38 |
# File 'lib/diaspora-cluster-creator/cluster.rb', line 36 def nodes @nodes ||= node_collection_builder.call end |
#to_s ⇒ Object
48 49 50 |
# File 'lib/diaspora-cluster-creator/cluster.rb', line 48 def to_s 'Cluster' end |