Class: MongoMapper::OrderOperator

Inherits:
Object
  • Object
show all
Defined in:
lib/mongo_mapper/finder_options.rb

Instance Method Summary collapse

Constructor Details

#initialize(field, direction) ⇒ OrderOperator

Returns a new instance of OrderOperator.



137
138
139
# File 'lib/mongo_mapper/finder_options.rb', line 137

def initialize(field, direction)
  @field, @direction = field, direction
end

Instance Method Details

#to_orderObject



141
142
143
# File 'lib/mongo_mapper/finder_options.rb', line 141

def to_order
  [@field.to_s, FinderOptions.normalized_order_direction(@direction)]
end