Module: Neo4j::Core::Cypher::Matchable

Included in:
NodeVar, Start
Defined in:
lib/neo4j-core/cypher/cypher.rb

Instance Method Summary collapse

Instance Method Details

#-(other) ⇒ MatchRelLeft, MatchNode

This operator means any direction related to

Parameters:

  • other (Symbol, #var_name, String)

    the relationship

Returns:



160
161
162
# File 'lib/neo4j-core/cypher/cypher.rb', line 160

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

#<(other) ⇒ MatchRelLeft, MatchNode

This operator means incoming related to

Parameters:

  • other (Symbol, #var_name, String)

    the relationship

Returns:



167
168
169
# File 'lib/neo4j-core/cypher/cypher.rb', line 167

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

#<<(other) ⇒ MatchRelLeft, MatchNode

Incoming relationship to other node

Parameters:

  • other (Symbol, #var_name)

    either a node (Symbol, #var_name)

Returns:



199
200
201
# File 'lib/neo4j-core/cypher/cypher.rb', line 199

def <<(other)
  MatchNode.new(self, other, expressions, :incoming)
end

#<=>(other) ⇒ MatchRelLeft, MatchNode

This operator means related to, without regard to type or direction.

Parameters:

  • other (Symbol, #var_name)

    either a node (Symbol, #var_name)

Returns:



146
147
148
# File 'lib/neo4j-core/cypher/cypher.rb', line 146

def <=>(other)
  MatchNode.new(self, other, expressions, :both)
end

#>(other) ⇒ MatchRelLeft, MatchNode

This operator means outgoing related to

Parameters:

  • other (Symbol, #var_name, String)

    the relationship

Returns:



153
154
155
# File 'lib/neo4j-core/cypher/cypher.rb', line 153

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

#>>(other) ⇒ MatchRelLeft, MatchNode

Outgoing relationship to other node

Parameters:

  • other (Symbol, #var_name)

    either a node (Symbol, #var_name)

Returns:



174
175
176
# File 'lib/neo4j-core/cypher/cypher.rb', line 174

def >>(other)
  MatchNode.new(self, other, expressions, :outgoing)
end

#both(rel_type) ⇒ Object



190
191
192
193
194
# File 'lib/neo4j-core/cypher/cypher.rb', line 190

def both(rel_type)
  node = NodeVar.new(@expressions, @variables)
  MatchRelLeft.new(self, ":`#{rel_type}`", expressions, :both) < node
  node
end

#incoming(rel_type) ⇒ Object



184
185
186
187
188
# File 'lib/neo4j-core/cypher/cypher.rb', line 184

def incoming(rel_type)
  node = NodeVar.new(@expressions, @variables)
  MatchRelLeft.new(self, ":`#{rel_type}`", expressions, :incoming) < node
  node
end

#outgoing(rel_type) ⇒ Object



178
179
180
181
182
# File 'lib/neo4j-core/cypher/cypher.rb', line 178

def outgoing(rel_type)
  node = NodeVar.new(@expressions, @variables)
  MatchRelLeft.new(self, ":`#{rel_type}`", expressions, :outgoing) > node
  node
end