Class: Neo4j::Cypher::ReturnItem
- Inherits:
-
Object
- Object
- Neo4j::Cypher::ReturnItem
- Includes:
- Clause
- Defined in:
- lib/neo4j-cypher/return.rb
Overview
The return statement in the cypher query
Defined Under Namespace
Classes: EvalContext
Constant Summary
Constants included from Clause
Instance Attribute Summary collapse
-
#order_by ⇒ Object
Returns the value of attribute order_by.
Attributes included from Clause
#clause_list, #clause_type, #eval_context, #expr, #insert_order
Instance Method Summary collapse
-
#initialize(clause_list, name_or_ref) ⇒ ReturnItem
constructor
A new instance of ReturnItem.
- #return_value ⇒ Object
- #return_value_with_alias ⇒ Object
- #var_name ⇒ Object
Methods included from Clause
#<=>, #alias_name, #as_alias, #as_alias?, #clause_position, #create_clause_args_for, #match_value, #match_value=, #prefix, #referenced!, #referenced?, #separator, #to_prop_string, #valid_clause?, #var_name=
Constructor Details
#initialize(clause_list, name_or_ref) ⇒ ReturnItem
Returns a new instance of ReturnItem.
89 90 91 92 93 94 95 96 97 98 |
# File 'lib/neo4j-cypher/return.rb', line 89 def initialize(clause_list, name_or_ref) super(clause_list, :return_item, EvalContext) if name_or_ref.respond_to?(:clause) @delegated_clause = name_or_ref.clause @delegated_clause.referenced! as_alias(@delegated_clause.alias_name) if @delegated_clause.as_alias? else @return_value = name_or_ref.to_s end end |
Instance Attribute Details
#order_by ⇒ Object
Returns the value of attribute order_by.
87 88 89 |
# File 'lib/neo4j-cypher/return.rb', line 87 def order_by @order_by end |
Instance Method Details
#return_value ⇒ Object
108 109 110 |
# File 'lib/neo4j-cypher/return.rb', line 108 def return_value @delegated_clause ? @delegated_clause.return_value : @return_value end |
#return_value_with_alias ⇒ Object
104 105 106 |
# File 'lib/neo4j-cypher/return.rb', line 104 def return_value_with_alias as_alias? ? "#{return_value} as #{alias_name}" : return_value end |
#var_name ⇒ Object
100 101 102 |
# File 'lib/neo4j-cypher/return.rb', line 100 def var_name @var_name || (@delegated_clause && @delegated_clause.var_name) || @return_value.to_sym end |