Class: Neo4j::Cypher::With
- Inherits:
-
Object
- Object
- Neo4j::Cypher::With
- Includes:
- Clause
- Defined in:
- lib/neo4j-cypher/with.rb
Defined Under Namespace
Classes: EvalContext
Constant Summary
Constants included from Clause
Instance Attribute Summary collapse
-
#arg_list ⇒ Object
readonly
Returns the value of attribute arg_list.
Attributes included from Clause
#clause_list, #clause_type, #eval_context, #expr, #insert_order
Instance Method Summary collapse
-
#initialize(clause_list, where_or_match, *args, &cypher_dsl) ⇒ With
constructor
A new instance of With.
- #to_cypher ⇒ Object
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, where_or_match, *args, &cypher_dsl) ⇒ With
Returns a new instance of With.
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/neo4j-cypher/with.rb', line 8 def initialize(clause_list, where_or_match, *args, &cypher_dsl) super(clause_list, :with, EvalContext) clause_list.push @args = create_clause_args_for(args) @arg_list = @args.map { |a| a.return_value }.join(',') arg_exec = @args.map(&:eval_context) RootClause::EvalContext.new(self).instance_exec(*arg_exec, &cypher_dsl) @body = "#{where_or_match.to_s.upcase} #{clause_list.to_cypher}" clause_list.pop end |
Instance Attribute Details
#arg_list ⇒ Object (readonly)
Returns the value of attribute arg_list.
6 7 8 |
# File 'lib/neo4j-cypher/with.rb', line 6 def arg_list @arg_list end |
Instance Method Details
#to_cypher ⇒ Object
22 23 24 |
# File 'lib/neo4j-cypher/with.rb', line 22 def to_cypher @body ? "#{@arg_list} #{@body}" : @arg_list end |