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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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_namesObject (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

#namesObject (readonly)

Returns the value of attribute names.



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

def names
  @names
end

#settingsObject (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

#attributesObject



44
45
46
# File 'lib/diaspora-cluster-creator/cluster.rb', line 44

def attributes
  @attributes ||= attribute_collection_builder.call
end

#each_attributeObject



32
33
34
# File 'lib/diaspora-cluster-creator/cluster.rb', line 32

def each_attribute
  attributes.each { |attribute| yield(attribute) }
end

#each_edgeObject



28
29
30
# File 'lib/diaspora-cluster-creator/cluster.rb', line 28

def each_edge
  edges.each { |edge| yield(edge) }
end

#each_nodeObject



24
25
26
# File 'lib/diaspora-cluster-creator/cluster.rb', line 24

def each_node
  nodes.each { |node| yield(node) }
end

#edgesObject



40
41
42
# File 'lib/diaspora-cluster-creator/cluster.rb', line 40

def edges
  @edges ||= edge_collection_builder.call
end

#nodesObject



36
37
38
# File 'lib/diaspora-cluster-creator/cluster.rb', line 36

def nodes
  @nodes ||= node_collection_builder.call
end

#to_sObject



48
49
50
# File 'lib/diaspora-cluster-creator/cluster.rb', line 48

def to_s
  'Cluster'
end