Class: Misc::BucketOrder
- Inherits:
-
Object
- Object
- Misc::BucketOrder
- Includes:
- AttributesReader
- Defined in:
- lib/misc/bucket_order.rb
Overview
Aggregations::Buckets ordering strategy.
Instance Method Summary collapse
-
#initialize(field:, order: Enums::SortOrders.desc) ⇒ BucketOrder
constructor
A new instance of BucketOrder.
-
#settings ⇒ Object
return [Hash].
Methods included from AttributesReader
Constructor Details
#initialize(field:, order: Enums::SortOrders.desc) ⇒ BucketOrder
Returns a new instance of BucketOrder.
11 12 13 14 |
# File 'lib/misc/bucket_order.rb', line 11 def initialize(field:, order: Enums::SortOrders.desc) @field = field.intern @order = order end |
Instance Method Details
#settings ⇒ Object
return [Hash]
17 18 19 |
# File 'lib/misc/bucket_order.rb', line 17 def settings {@field => @order.sort_order} end |