Module: Neo4j::Cypher::Context::Matchable
- Defined in:
- lib/neo4j-cypher/context.rb
Instance Method Summary collapse
-
#-(other) ⇒ MatchRelLeft, MatchNode
This operator means any direction related to.
-
#<(other) ⇒ MatchRelLeft, MatchNode
This operator means incoming related to.
-
#<<(other) ⇒ MatchRelLeft, MatchNode
Incoming relationship to other node.
-
#<=>(other) ⇒ MatchRelLeft, MatchNode
This operator means related to, without regard to type or direction.
- #==(other) ⇒ Object
-
#>(other) ⇒ MatchRelLeft, MatchNode
This operator means outgoing related to.
-
#>>(other) ⇒ MatchRelLeft, MatchNode
Outgoing relationship to other node.
- #_get_or_create_node(rel_types) ⇒ Object
- #both(*rel_types) ⇒ Object
- #both?(*rel_types) ⇒ Boolean
- #create_path(*args, &cypher_dsl) ⇒ Object
- #create_unique_path(*args, &cypher_dsl) ⇒ Object
- #incoming(*rel_types) ⇒ Object
- #incoming?(*rel_types) ⇒ Boolean
- #match(&cypher_dsl) ⇒ Object
- #outgoing(*rel_types) ⇒ Object
- #outgoing?(*rel_types) ⇒ Boolean
- #with(*args, &cypher_dsl) ⇒ Object
- #with_match(*args, &cypher_dsl) ⇒ Object
Instance Method Details
#-(other) ⇒ MatchRelLeft, MatchNode
This operator means any direction related to
370 371 372 |
# File 'lib/neo4j-cypher/context.rb', line 370 def -(other) MatchStart.new(clause).new_match_rel(other).eval_context end |
#<(other) ⇒ MatchRelLeft, MatchNode
This operator means incoming related to
377 378 379 |
# File 'lib/neo4j-cypher/context.rb', line 377 def <(other) MatchStart.new(clause).new_match_rel(other).eval_context end |
#<<(other) ⇒ MatchRelLeft, MatchNode
Incoming relationship to other node
391 392 393 |
# File 'lib/neo4j-cypher/context.rb', line 391 def <<(other) MatchStart.new_match_node(clause, other, :incoming).eval_context end |
#<=>(other) ⇒ MatchRelLeft, MatchNode
This operator means related to, without regard to type or direction.
356 357 358 |
# File 'lib/neo4j-cypher/context.rb', line 356 def <=>(other) MatchStart.new_match_node(clause, other, :both).eval_context end |
#==(other) ⇒ Object
322 323 324 |
# File 'lib/neo4j-cypher/context.rb', line 322 def ==(other) Operator.new(clause_list, clause, other, "=").eval_context end |
#>(other) ⇒ MatchRelLeft, MatchNode
This operator means outgoing related to
363 364 365 |
# File 'lib/neo4j-cypher/context.rb', line 363 def >(other) MatchStart.new(clause).new_match_rel(other).eval_context end |
#>>(other) ⇒ MatchRelLeft, MatchNode
Outgoing relationship to other node
384 385 386 |
# File 'lib/neo4j-cypher/context.rb', line 384 def >>(other) MatchStart.new_match_node(clause, other, :outgoing).eval_context end |
#_get_or_create_node(rel_types) ⇒ Object
401 402 403 |
# File 'lib/neo4j-cypher/context.rb', line 401 def _get_or_create_node(rel_types) rel_types.last.kind_of?(Matchable) ? rel_types.pop.clause : NodeVar.new(clause.clause_list) end |
#both(*rel_types) ⇒ Object
423 424 425 426 427 |
# File 'lib/neo4j-cypher/context.rb', line 423 def both(*rel_types) node = _get_or_create_node(rel_types) MatchStart.new(clause).new_match_rels(rel_types).eval_context - node node.eval_context end |
#both?(*rel_types) ⇒ Boolean
429 430 431 432 433 |
# File 'lib/neo4j-cypher/context.rb', line 429 def both?(*rel_types) node = _get_or_create_node(rel_types) MatchStart.new(clause).new_match_rels?(rel_types).eval_context - node node.eval_context end |
#create_path(*args, &cypher_dsl) ⇒ Object
342 343 344 345 |
# File 'lib/neo4j-cypher/context.rb', line 342 def create_path(*args, &cypher_dsl) CreatePath.new(clause_list, self, *args, &cypher_dsl) self end |
#create_unique_path(*args, &cypher_dsl) ⇒ Object
347 348 349 350 |
# File 'lib/neo4j-cypher/context.rb', line 347 def create_unique_path(*args, &cypher_dsl) CreatePath.new(clause_list, self, *args, &cypher_dsl).unique! self end |
#incoming(*rel_types) ⇒ Object
411 412 413 414 415 |
# File 'lib/neo4j-cypher/context.rb', line 411 def incoming(*rel_types) node = _get_or_create_node(rel_types) MatchStart.new(clause).new_match_rels(rel_types).eval_context < node node.eval_context end |
#incoming?(*rel_types) ⇒ Boolean
417 418 419 420 421 |
# File 'lib/neo4j-cypher/context.rb', line 417 def incoming?(*rel_types) node = _get_or_create_node(rel_types) MatchStart.new(clause).new_match_rels?(rel_types).eval_context < node node.eval_context end |
#match(&cypher_dsl) ⇒ Object
327 328 329 330 |
# File 'lib/neo4j-cypher/context.rb', line 327 def match(&cypher_dsl) RootClause::EvalContext.new(self).instance_exec(self, &cypher_dsl) self end |
#outgoing(*rel_types) ⇒ Object
395 396 397 398 399 |
# File 'lib/neo4j-cypher/context.rb', line 395 def outgoing(*rel_types) node = _get_or_create_node(rel_types) MatchStart.new(clause).new_match_rels(rel_types).eval_context > node node.eval_context end |
#outgoing?(*rel_types) ⇒ Boolean
405 406 407 408 409 |
# File 'lib/neo4j-cypher/context.rb', line 405 def outgoing?(*rel_types) node = _get_or_create_node(rel_types) MatchStart.new(clause).new_match_rels?(rel_types).eval_context > node node.eval_context end |