Class: Neo4j::Cypher::Start

Inherits:
Object
  • Object
show all
Includes:
Clause
Defined in:
lib/neo4j-cypher/start.rb

Direct Known Subclasses

LuceneQuery, StartNode, StartRel

Defined Under Namespace

Classes: EvalContext

Constant Summary

Constants included from Clause

Clause::NAME, Clause::ORDER

Instance Attribute Summary

Attributes included from Clause

#clause_list, #clause_type, #eval_context, #expr, #insert_order

Instance Method Summary collapse

Methods included from Clause

#<=>, #alias_name, #as_alias, #as_alias?, #clause_position, #create_clause_args_for, #match_value, #match_value=, #prefix, #referenced!, #referenced?, #return_value, #separator, #to_prop_string, #valid_clause?, #var_name, #var_name=

Constructor Details

#initialize(clause_list, rvalue) ⇒ Start

Returns a new instance of Start.



6
7
8
9
# File 'lib/neo4j-cypher/start.rb', line 6

def initialize(clause_list, rvalue)
  super(clause_list, :start, EvalContext)
  @rvalue = rvalue
end

Instance Method Details

#entity_list(entity_type, entities) ⇒ Object



11
12
13
14
# File 'lib/neo4j-cypher/start.rb', line 11

def entity_list(entity_type, entities)
  list = entities.map { |n| n.respond_to?(:neo_id) ? n.neo_id : n }.join(',')
  "#{entity_type}(#{list})"
end

#to_cypherObject



16
17
18
# File 'lib/neo4j-cypher/start.rb', line 16

def to_cypher
  "#{var_name}=#{@rvalue}"
end