Class: Neo4j::Core::QueryClauses::CreateClause
- Inherits:
-
Clause
- Object
- Clause
- Neo4j::Core::QueryClauses::CreateClause
show all
- Defined in:
- lib/neo4j-core/query_clauses.rb
Constant Summary
collapse
- KEYWORD =
'CREATE'
Constants inherited
from Clause
Neo4j::Core::QueryClauses::Clause::AND, Neo4j::Core::QueryClauses::Clause::COMMA_SPACE, Neo4j::Core::QueryClauses::Clause::PRETTY_NEW_LINE, Neo4j::Core::QueryClauses::Clause::UNDERSCORE
Instance Attribute Summary
Attributes inherited from Clause
#arg, #options, #param_vars_added, #params
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Clause
#_nested_value_hash?, #_use_key_for_var?, #add_param, #add_params, #attributes_from_key_and_value, clause_string, from_arg, from_args, from_key_and_single_value, #initialize, keyword, keyword_downcase, #label_from_key_and_value, #node_from_key_and_value, paramaterize_key!, to_cypher, #value, #var_from_key_and_value
Class Method Details
.clause_color ⇒ Object
464
465
466
|
# File 'lib/neo4j-core/query_clauses.rb', line 464
def clause_color
ANSI::GREEN
end
|
.clause_join ⇒ Object
460
461
462
|
# File 'lib/neo4j-core/query_clauses.rb', line 460
def clause_join
', '
end
|
.clause_strings(clauses) ⇒ Object
456
457
458
|
# File 'lib/neo4j-core/query_clauses.rb', line 456
def clause_strings(clauses)
clauses.map!(&:value)
end
|
Instance Method Details
#from_hash(hash) ⇒ Object
441
442
443
444
445
446
447
448
449
|
# File 'lib/neo4j-core/query_clauses.rb', line 441
def from_hash(hash)
if hash.values.any? { |value| value.is_a?(Hash) }
hash.map do |key, value|
from_key_and_value(key, value)
end
else
"(#{attributes_string(hash)})"
end
end
|
#from_key_and_value(key, value) ⇒ Object
451
452
453
|
# File 'lib/neo4j-core/query_clauses.rb', line 451
def from_key_and_value(key, value)
node_from_key_and_value(key, value, prefer: :label)
end
|
#from_string(value) ⇒ Object
433
434
435
|
# File 'lib/neo4j-core/query_clauses.rb', line 433
def from_string(value)
value
end
|
#from_symbol(value) ⇒ Object
437
438
439
|
# File 'lib/neo4j-core/query_clauses.rb', line 437
def from_symbol(value)
"(:#{value})"
end
|