Module: Neo4j::Cypher::Context::ReturnOrder
- Defined in:
- lib/neo4j-cypher/context.rb
Instance Method Summary collapse
- #_sort_args(props) ⇒ Object
-
#asc(*props) ⇒ Object
Specifies an
ORDER BY
cypher query. -
#desc(*props) ⇒ Object
Specifies an
ORDER BY
cypher query. -
#limit(val) ⇒ Object
Creates a
LIMIT
cypher clause. -
#skip(val) ⇒ Object
Creates a
SKIP
cypher clause.
Instance Method Details
#_sort_args(props) ⇒ Object
181 182 183 184 |
# File 'lib/neo4j-cypher/context.rb', line 181 def _sort_args(props) return [self] if props.empty? props.map { |p| p.is_a?(Symbol) ? Property.new(clause, p).eval_context : p } end |
#asc(*props) ⇒ Object
Specifies an ORDER BY
cypher query
189 190 191 192 193 194 |
# File 'lib/neo4j-cypher/context.rb', line 189 def asc(*props) @order_by ||= OrderBy.new(clause_list, self) clause_list.delete(props.first) @order_by.asc(_sort_args(props)) self end |
#desc(*props) ⇒ Object
Specifies an ORDER BY
cypher query
199 200 201 202 203 204 |
# File 'lib/neo4j-cypher/context.rb', line 199 def desc(*props) @order_by ||= OrderBy.new(clause_list, self) clause_list.delete(props.first) @order_by.desc(_sort_args(props)) self end |