Class: Boolminot::Clauses::Compounds::Conjunction
- Inherits:
-
Logica::Predicates::Compounds::Conjunction
- Object
- Logica::Predicates::Compounds::Conjunction
- Boolminot::Clauses::Compounds::Conjunction
- Extended by:
- Base::ClassMethods, Base::ClassMethods
- Includes:
- Base::InstanceMethods, Base::InstanceMethods
- Defined in:
- lib/boolminot/clauses/compounds/conjunction.rb
Instance Method Summary collapse
Methods included from Base::ClassMethods
Methods included from Base::InstanceMethods
Methods included from Base::InstanceMethods
#satisfied_by?, #to_elasticsearch_negated, #to_raw_bool
Instance Method Details
#to_elasticsearch(options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/boolminot/clauses/compounds/conjunction.rb', line 11 def to_elasticsearch( = {}) bool = clauses.reduce({}) do |sections, clause| more_sections = clause.to_raw_bool(.merge(added_to: sections)).fetch(:bool) sections.merge(more_sections) do |_, old_val, new_val| old_val + new_val end end { bool: bool } end |