Class: Neo4j::Core::Cypher::StartNode

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

Overview

Can be created from a node dsl method.

Instance Attribute Summary collapse

Attributes inherited from Start

#var_name

Attributes included from Variable

#return_method

Attributes inherited from Expression

#clause, #expressions, #separator

Instance Method Summary collapse

Methods included from Matchable

#-, #<, #<<, #<=>, #>, #>>, #both, #incoming, #outgoing, #where, #where_not

Methods included from Variable

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

Methods inherited from Expression

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

Constructor Details

#initialize(nodes, expressions) ⇒ StartNode

Returns a new instance of StartNode.



375
376
377
378
379
# File 'lib/neo4j-core/cypher/cypher.rb', line 375

def initialize(nodes, expressions)
  super("n", expressions)

  @nodes = nodes.map { |n| n.respond_to?(:neo_id) ? n.neo_id : n }
end

Instance Attribute Details

#nodesObject (readonly)



373
374
375
# File 'lib/neo4j-core/cypher/cypher.rb', line 373

def nodes
  @nodes
end

Instance Method Details

#to_sObject



381
382
383
# File 'lib/neo4j-core/cypher/cypher.rb', line 381

def to_s
  "#{var_name}=node(#{nodes.join(',')})"
end