Class: MongoQL::Expression::Descend

Inherits:
MongoQL::Expression show all
Defined in:
lib/mongo_ql/expression/descend.rb

Constant Summary

Constants inherited from MongoQL::Expression

FORMATING_OPS

Constants included from CollectionOperators

CollectionOperators::AGGREGATE_OPS

Constants included from UnaryOperators

UnaryOperators::UNARY_OPS

Constants included from BinaryOperators

BinaryOperators::BINARY_OPS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from MongoQL::Expression

#as_date, #if_null, #then, #type

Methods included from StringOperators

#concat, #substr, #trim

Methods included from CollectionOperators

#any?, #concat_arrays, #contains, #filter, #map, #reduce

Constructor Details

#initialize(field) ⇒ Descend

Returns a new instance of Descend.



7
8
9
# File 'lib/mongo_ql/expression/descend.rb', line 7

def initialize(field)
  @field = field
end

Instance Attribute Details

#fieldObject

Returns the value of attribute field.



5
6
7
# File 'lib/mongo_ql/expression/descend.rb', line 5

def field
  @field
end

Instance Method Details

#to_astObject



11
12
13
# File 'lib/mongo_ql/expression/descend.rb', line 11

def to_ast
  { field.to_s => -1 }
end