Class: RediSearch::Search::Clauses::SortBy
- Inherits:
-
ApplicationClause
- Object
- ApplicationClause
- RediSearch::Search::Clauses::SortBy
- Defined in:
- lib/redi_search/search/clauses/sort_by.rb
Instance Method Summary collapse
- #clause ⇒ Object
-
#initialize(field:, order: :asc) ⇒ SortBy
constructor
A new instance of SortBy.
Methods inherited from ApplicationClause
#clause_order, clause_order, clause_term
Methods included from Validatable
Constructor Details
#initialize(field:, order: :asc) ⇒ SortBy
Returns a new instance of SortBy.
11 12 13 14 |
# File 'lib/redi_search/search/clauses/sort_by.rb', line 11 def initialize(field:, order: :asc) @field = field @order = order.to_sym end |
Instance Method Details
#clause ⇒ Object
16 17 18 19 20 |
# File 'lib/redi_search/search/clauses/sort_by.rb', line 16 def clause validate! ["SORTBY", field, order] end |