Class: Boolminot::Clauses::MatchNone
- Inherits:
-
Logica::Predicates::Contradiction
- Object
- Logica::Predicates::Contradiction
- Boolminot::Clauses::MatchNone
- Extended by:
- Base::ClassMethods
- Includes:
- Base::InstanceMethods
- Defined in:
- lib/boolminot/clauses/match_none.rb
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ MatchNone
constructor
A new instance of MatchNone.
-
#to_elasticsearch(options = {}) ⇒ Object
only for compatibility with Elasticsearch 1.x and 2.x otherwise, defining body as opts would suffice.
- #to_raw_bool(options = {}) ⇒ Object
Methods included from Base::ClassMethods
Methods included from Base::InstanceMethods
#satisfied_by?, #to_elasticsearch_negated
Constructor Details
#initialize(opts = {}) ⇒ MatchNone
Returns a new instance of MatchNone.
7 8 9 |
# File 'lib/boolminot/clauses/match_none.rb', line 7 def initialize(opts = {}) @opts = opts end |
Instance Method Details
#to_elasticsearch(options = {}) ⇒ Object
only for compatibility with Elasticsearch 1.x and 2.x otherwise, defining body as opts would suffice
13 14 15 |
# File 'lib/boolminot/clauses/match_none.rb', line 13 def to_elasticsearch( = {}) to_raw_bool() end |
#to_raw_bool(options = {}) ⇒ Object
17 18 19 |
# File 'lib/boolminot/clauses/match_none.rb', line 17 def to_raw_bool( = {}) { bool: { must_not: [negated.to_elasticsearch()] } } end |