Class: Elasticquery::Filters::Term
- Defined in:
- lib/elasticquery/filters/term.rb
Constant Summary collapse
- OPTIONS =
%i(_cache)
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ Term
constructor
A new instance of Term.
- #to_hash ⇒ Object
- #valid? ⇒ Boolean
Methods inherited from Base
#dup_with, #invalid?, #to_not_hash
Constructor Details
Instance Method Details
#to_hash ⇒ Object
17 18 19 |
# File 'lib/elasticquery/filters/term.rb', line 17 def to_hash {term: @condition.merge(@options)} end |
#valid? ⇒ Boolean
13 14 15 |
# File 'lib/elasticquery/filters/term.rb', line 13 def valid? @condition.keys.size == 1 && @condition.values[0].present? end |