Class: Elasticquery::Filters::Not
- Defined in:
- lib/elasticquery/filters/not.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #dup_with(*args) ⇒ Object
-
#initialize(*args) ⇒ Not
constructor
A new instance of Not.
- #to_hash ⇒ Object
- #valid? ⇒ Boolean
Methods inherited from Base
#build, build, #filterable?, filtered
Methods included from Builder
#exists, #filters, #missing, #multi_match, #not, #queries, #range, #search, #term, #terms, #where, #with, #without
Constructor Details
#initialize(*args) ⇒ Not
Returns a new instance of Not.
7 8 9 |
# File 'lib/elasticquery/filters/not.rb', line 7 def initialize(*args) @args = Marshal.load(Marshal.dump(args)) end |
Instance Method Details
#dup_with(*args) ⇒ Object
11 12 13 |
# File 'lib/elasticquery/filters/not.rb', line 11 def dup_with(*args) raise StandardError, "Cannot use Filters::Not twice" end |
#to_hash ⇒ Object
20 21 22 23 |
# File 'lib/elasticquery/filters/not.rb', line 20 def to_hash args = @args -> { filters[-2].dup_with(*args).to_not_hash } end |
#valid? ⇒ Boolean
15 16 17 18 |
# File 'lib/elasticquery/filters/not.rb', line 15 def valid? args = @args -> { filters[-2].dup_with(*args).valid? } end |