Module: Neo4j::Cypher::MatchStart::MatchContext
- Included in:
- NodeMatchContext, RelLeftMatchContext, RelRightMatchContext
- Defined in:
- lib/neo4j-cypher/match.rb
Instance Method Summary collapse
- #clause ⇒ Object
- #convert_create_clauses(to_or_from) ⇒ Object
- #initialize(match_start) ⇒ Object
- #join_previous! ⇒ Object
- #join_previous? ⇒ Boolean
-
#length ⇒ Object
returns the length of the path.
-
#nodes ⇒ Object
Generates a
x in nodes(m3)
cypher expression. - #not ⇒ Object
-
#rels ⇒ Object
Generates a
x in relationships(m3)
cypher expression. - #to_cypher ⇒ Object
Instance Method Details
#clause ⇒ Object
85 86 87 |
# File 'lib/neo4j-cypher/match.rb', line 85 def clause @match_start end |
#convert_create_clauses(to_or_from) ⇒ Object
76 77 78 79 80 81 82 83 |
# File 'lib/neo4j-cypher/match.rb', line 76 def convert_create_clauses(to_or_from) # perform a create operation in a match clause ? c = to_or_from.respond_to?(:clause) ? to_or_from.clause : to_or_from if c.respond_to?(:clause_type) && c.clause_type == :create clause_list.delete(c) c.as_create_path! end end |
#initialize(match_start) ⇒ Object
70 71 72 73 74 |
# File 'lib/neo4j-cypher/match.rb', line 70 def initialize(match_start) super(match_start) @match_start = match_start @match_start.match_list << self end |
#join_previous! ⇒ Object
89 90 91 92 |
# File 'lib/neo4j-cypher/match.rb', line 89 def join_previous! @join_previous = true self end |
#join_previous? ⇒ Boolean
94 95 96 |
# File 'lib/neo4j-cypher/match.rb', line 94 def join_previous? @join_previous end |
#length ⇒ Object
returns the length of the path
123 124 125 126 |
# File 'lib/neo4j-cypher/match.rb', line 123 def length clause.referenced! Property.new(clause, 'length').to_function! end |
#nodes ⇒ Object
Generates a x in nodes(m3)
cypher expression.
110 111 112 |
# File 'lib/neo4j-cypher/match.rb', line 110 def nodes Entities.new(clause.clause_list, "nodes", self).eval_context end |
#not ⇒ Object
128 129 130 |
# File 'lib/neo4j-cypher/match.rb', line 128 def not clause.not end |
#rels ⇒ Object
Generates a x in relationships(m3)
cypher expression.
118 119 120 |
# File 'lib/neo4j-cypher/match.rb', line 118 def rels Entities.new(clause.clause_list, "relationships", self).eval_context end |
#to_cypher ⇒ Object
98 99 100 101 102 103 104 |
# File 'lib/neo4j-cypher/match.rb', line 98 def to_cypher if join_previous? to_cypher_join else to_cypher_no_join end end |