Class: RediSearch::Aggregate::Reducers::Quantile
- Inherits:
-
RediSearch::ApplicationClause
- Object
- RediSearch::ApplicationClause
- RediSearch::Aggregate::Reducers::Quantile
- Defined in:
- lib/redi_search/aggregate/reducers/quantile.rb
Instance Method Summary collapse
- #clause ⇒ Object
-
#initialize(property:, quantile:, as:) ⇒ Quantile
constructor
A new instance of Quantile.
Methods inherited from RediSearch::ApplicationClause
#clause_order, clause_order, clause_term
Methods included from Validatable
Constructor Details
#initialize(property:, quantile:, as:) ⇒ Quantile
13 14 15 16 17 18 |
# File 'lib/redi_search/aggregate/reducers/quantile.rb', line 13 def initialize(property:, quantile:, as:) @property = property.to_s @property.prepend("@") unless @property.start_with?("@") @quantile = quantile @as = as end |
Instance Method Details
#clause ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/redi_search/aggregate/reducers/quantile.rb', line 20 def clause validate! command = ["REDUCE", "QUANTILE", 2, property, quantile] command += ["AS", as] if as command end |