Class: RediSearch::Aggregate::Clauses::SortBy::Sortable
- Inherits:
-
RediSearch::ApplicationClause
- Object
- RediSearch::ApplicationClause
- RediSearch::Aggregate::Clauses::SortBy::Sortable
- Defined in:
- lib/redi_search/aggregate/clauses/sort_by.rb
Instance Method Summary collapse
- #clause ⇒ Object
-
#initialize(field, order = :asc) ⇒ Sortable
constructor
A new instance of Sortable.
Methods inherited from RediSearch::ApplicationClause
#clause_order, clause_order, clause_term
Methods included from Validatable
Constructor Details
#initialize(field, order = :asc) ⇒ Sortable
12 13 14 15 16 |
# File 'lib/redi_search/aggregate/clauses/sort_by.rb', line 12 def initialize(field, order = :asc) @field = field.to_s @field.prepend("@") unless @field.start_with?("@") @order = order.to_sym end |
Instance Method Details
#clause ⇒ Object
18 19 20 |
# File 'lib/redi_search/aggregate/clauses/sort_by.rb', line 18 def clause [field, order.to_s.upcase] end |