Class: Elasticated::BooleanClause
- Inherits:
-
Object
- Object
- Elasticated::BooleanClause
- Includes:
- ConditionsBuilder, Mixins::Clonable, Mixins::Inspectionable
- Defined in:
- lib/elasticated/boolean_clause.rb
Instance Attribute Summary collapse
-
#conditions ⇒ Object
Returns the value of attribute conditions.
Instance Method Summary collapse
-
#add(condition) ⇒ Object
conditions.
- #build ⇒ Object
- #build_first ⇒ Object
- #count ⇒ Object
- #empty? ⇒ Boolean
-
#fill_delimiter(field_delimiter) ⇒ Object
delimiters.
-
#initialize ⇒ BooleanClause
constructor
A new instance of BooleanClause.
Methods included from ConditionsBuilder
#boolean, #custom, #exists, #greater_equal, #greater_than, #less_equal, #less_than, #missing, #nested, #now, #range, #script, #term, #terms, #wildcard, #with
Methods included from Mixins::BlockEvaluation
Methods included from Mixins::Inspectionable
Methods included from Mixins::Clonable
Constructor Details
#initialize ⇒ BooleanClause
Returns a new instance of BooleanClause.
9 10 11 |
# File 'lib/elasticated/boolean_clause.rb', line 9 def initialize self.conditions = Array.new end |
Instance Attribute Details
#conditions ⇒ Object
Returns the value of attribute conditions.
7 8 9 |
# File 'lib/elasticated/boolean_clause.rb', line 7 def conditions @conditions end |
Instance Method Details
#add(condition) ⇒ Object
conditions
21 22 23 |
# File 'lib/elasticated/boolean_clause.rb', line 21 def add(condition) conditions << condition end |
#build ⇒ Object
35 36 37 |
# File 'lib/elasticated/boolean_clause.rb', line 35 def build conditions.map &:build end |
#build_first ⇒ Object
39 40 41 |
# File 'lib/elasticated/boolean_clause.rb', line 39 def build_first conditions.first.build end |
#count ⇒ Object
27 28 29 |
# File 'lib/elasticated/boolean_clause.rb', line 27 def count conditions.count end |
#empty? ⇒ Boolean
31 32 33 |
# File 'lib/elasticated/boolean_clause.rb', line 31 def empty? count == 0 end |
#fill_delimiter(field_delimiter) ⇒ Object
delimiters
15 16 17 |
# File 'lib/elasticated/boolean_clause.rb', line 15 def fill_delimiter(field_delimiter) conditions.each{ |condition| condition.fill_delimiter field_delimiter } end |