Class: MongoMapper::OrderOperator
- Defined in:
- lib/mongo_mapper/finder_options.rb
Instance Method Summary collapse
-
#initialize(field, direction) ⇒ OrderOperator
constructor
A new instance of OrderOperator.
- #to_order ⇒ Object
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_order ⇒ Object
141 142 143 |
# File 'lib/mongo_mapper/finder_options.rb', line 141 def to_order [@field.to_s, FinderOptions.normalized_order_direction(@direction)] end |