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
380 381 382 |
# File 'lib/neo4j-cypher/context.rb', line 380 def -(other) MatchStart.new(clause).new_match_rel(other).eval_context end |
#<(other) ⇒ MatchRelLeft, MatchNode
This operator means incoming related to
387 388 389 |
# File 'lib/neo4j-cypher/context.rb', line 387 def <(other) MatchStart.new(clause).new_match_rel(other).eval_context end |
#<<(other) ⇒ MatchRelLeft, MatchNode
Incoming relationship to other node
401 402 403 |
# File 'lib/neo4j-cypher/context.rb', line 401 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.
366 367 368 |
# File 'lib/neo4j-cypher/context.rb', line 366 def <=>(other) MatchStart.new_match_node(clause, other, :both).eval_context end |
#==(other) ⇒ Object
332 333 334 |
# File 'lib/neo4j-cypher/context.rb', line 332 def ==(other) Operator.new(clause_list, clause, other, "=").eval_context end |
#>(other) ⇒ MatchRelLeft, MatchNode
This operator means outgoing related to
373 374 375 |
# File 'lib/neo4j-cypher/context.rb', line 373 def >(other) MatchStart.new(clause).new_match_rel(other).eval_context end |
#>>(other) ⇒ MatchRelLeft, MatchNode
Outgoing relationship to other node
394 395 396 |
# File 'lib/neo4j-cypher/context.rb', line 394 def >>(other) MatchStart.new_match_node(clause, other, :outgoing).eval_context end |
#_get_or_create_node(rel_types) ⇒ Object
411 412 413 |
# File 'lib/neo4j-cypher/context.rb', line 411 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
433 434 435 436 437 |
# File 'lib/neo4j-cypher/context.rb', line 433 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
439 440 441 442 443 |
# File 'lib/neo4j-cypher/context.rb', line 439 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
352 353 354 355 |
# File 'lib/neo4j-cypher/context.rb', line 352 def create_path(*args, &cypher_dsl) CreatePath.new(clause_list, self, *args, &cypher_dsl) self end |
#create_unique_path(*args, &cypher_dsl) ⇒ Object
357 358 359 360 |
# File 'lib/neo4j-cypher/context.rb', line 357 def create_unique_path(*args, &cypher_dsl) CreatePath.new(clause_list, self, *args, &cypher_dsl).unique! self end |
#incoming(*rel_types) ⇒ Object
421 422 423 424 425 |
# File 'lib/neo4j-cypher/context.rb', line 421 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
427 428 429 430 431 |
# File 'lib/neo4j-cypher/context.rb', line 427 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
337 338 339 340 |
# File 'lib/neo4j-cypher/context.rb', line 337 def match(&cypher_dsl) RootClause::EvalContext.new(self).instance_exec(self, &cypher_dsl) self end |
#outgoing(*rel_types) ⇒ Object
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 |
#outgoing?(*rel_types) ⇒ Boolean
415 416 417 418 419 |
# File 'lib/neo4j-cypher/context.rb', line 415 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 |