Class: Neo4j::Core::Cypher::MatchRelRight

Inherits:
Match show all
Defined in:
lib/neo4j-core/cypher/cypher.rb

Instance Attribute Summary

Attributes inherited from Match

#algorithm, #dir, #dir_op, #expressions, #left, #next, #prev, #right, #var_name

Attributes included from Variable

#return_method

Attributes inherited from Expression

#clause, #expressions, #separator

Instance Method Summary collapse

Methods inherited from Match

#find_match_start, #left_var_name, #length, #nodes, #referenced!, #referenced?, #rels, #right_expr, #right_var_name, #to_s

Methods included from Variable

#[], #as, #distinct, #exist?, #is_a?, #neo_id, #property?

Methods inherited from Expression

#insert_last, #prefix, #prefixes, #valid?

Constructor Details

#initialize(left, right, expressions, dir) ⇒ MatchRelRight

Returns a new instance of MatchRelRight.

Parameters:

  • left

    the left part of the query

  • right (Symbol, NodeVar, String)

    part of the match cypher statement.



592
593
594
# File 'lib/neo4j-core/cypher/cypher.rb', line 592

def initialize(left, right, expressions, dir)
  super(left, right, expressions, dir, dir == :outgoing ? '->' : '-')
end

Instance Method Details

#-(other) ⇒ MatchRelLeft

Returns the right part of an relationship cypher query.

Returns:

  • (MatchRelLeft)

    the right part of an relationship cypher query.

See Also:



612
613
614
615
# File 'lib/neo4j-core/cypher/cypher.rb', line 612

def -(other)
  expressions.delete(self)
  self.next = MatchRelLeft.new(self, other, expressions, :both)
end

#<(other) ⇒ MatchRelLeft

Returns the right part of an relationship cypher query.

Returns:

  • (MatchRelLeft)

    the right part of an relationship cypher query.

See Also:



605
606
607
608
# File 'lib/neo4j-core/cypher/cypher.rb', line 605

def <(other)
  expressions.delete(self)
  self.next = MatchRelLeft.new(self, other, expressions, :incoming)
end

#>(other) ⇒ MatchRelLeft

Returns the right part of an relationship cypher query.

Parameters:

  • other (Symbol, NodeVar, String)

    part of the match cypher statement.

Returns:

  • (MatchRelLeft)

    the right part of an relationship cypher query.



598
599
600
601
# File 'lib/neo4j-core/cypher/cypher.rb', line 598

def >(other)
  expressions.delete(self)
  self.next = MatchRelLeft.new(self, other, expressions, :outgoing)
end

#exprString

Returns a cypher string for this match.

Returns:

  • (String)

    a cypher string for this match.



618
619
620
# File 'lib/neo4j-core/cypher/cypher.rb', line 618

def expr
  "#{dir_op}(#{right_var_name})"
end

#notObject



622
623
624
625
# File 'lib/neo4j-core/cypher/cypher.rb', line 622

def not
  expressions.delete(self)
  ExprOp.new(left, nil, "not").binary!
end