Class: RediSearch::Aggregate::Clauses::Limit

Inherits:
RediSearch::ApplicationClause show all
Defined in:
lib/redi_search/aggregate/clauses/limit.rb

Instance Method Summary collapse

Methods inherited from RediSearch::ApplicationClause

#clause_order, clause_order, clause_term

Methods included from Validatable

included, #validate!

Constructor Details

#initialize(total:, offset: 0) ⇒ Limit



15
16
17
18
# File 'lib/redi_search/aggregate/clauses/limit.rb', line 15

def initialize(total:, offset: 0)
  @total = total
  @offset = offset
end

Instance Method Details

#clauseObject



20
21
22
23
24
# File 'lib/redi_search/aggregate/clauses/limit.rb', line 20

def clause
  validate!

  ["LIMIT", offset, total]
end