Method: Neo4j::Cypher::Create#to_cypher

Defined in:
lib/neo4j-cypher/create.rb

#to_cypherObject



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/neo4j-cypher/create.rb', line 54

def to_cypher
  label_suffix = @labels && ":" + @labels.map{|name| "`#{name.to_s}`"}.join(':')

  without_parantheses = if @props
                          "#{var_name}#{label_suffix} #{to_prop_string(@props)}"
                        else
                          "#{var_name}#{label_suffix}"
                        end

  as_create_path? ? without_parantheses : "(#{without_parantheses})"
end