Class: Pacer::GroupVertex
- Inherits:
-
Object
- Object
- Pacer::GroupVertex
- Defined in:
- lib/pacer/blueprints/group_vertex.rb
Overview
Created without property support, though it could easily be added if it is ever needed.
Constant Summary collapse
- IN =
com.tinkerpop.blueprints.Direction::IN
- OUT =
com.tinkerpop.blueprints.Direction::OUT
- BOTH =
com.tinkerpop.blueprints.Direction::BOTH
Instance Attribute Summary collapse
-
#components ⇒ Object
readonly
Returns the value of attribute components.
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
-
#wrapper ⇒ Object
readonly
Returns the value of attribute wrapper.
Instance Method Summary collapse
- #add_component(vertex) ⇒ Object
- #getEdges(direction, *labels) ⇒ Object
- #getId ⇒ Object
- #getProperty(key) ⇒ Object
- #getPropertyKeys ⇒ Object
- #getRawVertex ⇒ Object
- #getVertices(direction, *labels) ⇒ Object
-
#initialize(key, graph, wrapper, components = nil) ⇒ GroupVertex
constructor
Initialize it with an empty set to force uniqueness.
Constructor Details
#initialize(key, graph, wrapper, components = nil) ⇒ GroupVertex
Initialize it with an empty set to force uniqueness. Non-unique by default.
13 14 15 16 17 18 19 20 21 |
# File 'lib/pacer/blueprints/group_vertex.rb', line 13 def initialize(key, graph, wrapper, components = nil) @key = key @wrapper = wrapper if components @components = components else @components = [] end end |
Instance Attribute Details
#components ⇒ Object (readonly)
Returns the value of attribute components.
9 10 11 |
# File 'lib/pacer/blueprints/group_vertex.rb', line 9 def components @components end |
#graph ⇒ Object (readonly)
Returns the value of attribute graph.
10 11 12 |
# File 'lib/pacer/blueprints/group_vertex.rb', line 10 def graph @graph end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
9 10 11 |
# File 'lib/pacer/blueprints/group_vertex.rb', line 9 def key @key end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
10 11 12 |
# File 'lib/pacer/blueprints/group_vertex.rb', line 10 def paths @paths end |
#wrapper ⇒ Object (readonly)
Returns the value of attribute wrapper.
10 11 12 |
# File 'lib/pacer/blueprints/group_vertex.rb', line 10 def wrapper @wrapper end |
Instance Method Details
#add_component(vertex) ⇒ Object
23 24 25 |
# File 'lib/pacer/blueprints/group_vertex.rb', line 23 def add_component(vertex) components << vertex end |
#getEdges(direction, *labels) ⇒ Object
55 56 57 |
# File 'lib/pacer/blueprints/group_vertex.rb', line 55 def getEdges(direction, *labels) Pacer::Pipes::MultiPipe.new components.map { |v| v.getEdges(direction, *labels) } end |
#getId ⇒ Object
29 30 31 |
# File 'lib/pacer/blueprints/group_vertex.rb', line 29 def getId "#{ key }:#{ components.count }" end |
#getProperty(key) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/pacer/blueprints/group_vertex.rb', line 37 def getProperty(key) case key when 'components' then components.map { |c| wrapper.new graph, c } when 'key' then key when 'count' then components.count end end |
#getPropertyKeys ⇒ Object
33 34 35 |
# File 'lib/pacer/blueprints/group_vertex.rb', line 33 def getPropertyKeys Set[] end |
#getRawVertex ⇒ Object
47 48 49 |
# File 'lib/pacer/blueprints/group_vertex.rb', line 47 def getRawVertex self end |
#getVertices(direction, *labels) ⇒ Object
51 52 53 |
# File 'lib/pacer/blueprints/group_vertex.rb', line 51 def getVertices(direction, *labels) VerticesFromEdgesIterable.new self, direction, *labels end |