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