Class: Elasticated::BooleanClause
- Inherits:
-
Object
- Object
- Elasticated::BooleanClause
- Includes:
- Clonable, ConditionsBuilder
- 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
#between, #boolean, #custom, #equal, #exists, #greater_equal, #greater_than, #less_equal, #less_than, #missing, #nested, #script, #wildcard, #with
Methods included from BlockEvaluation
Methods included from Clonable
Constructor Details
#initialize ⇒ BooleanClause
Returns a new instance of BooleanClause.
8 9 10 |
# File 'lib/elasticated/boolean_clause.rb', line 8 def initialize self.conditions = Array.new end |
Instance Attribute Details
#conditions ⇒ Object
Returns the value of attribute conditions.
6 7 8 |
# File 'lib/elasticated/boolean_clause.rb', line 6 def conditions @conditions end |
Instance Method Details
#add(condition) ⇒ Object
conditions
20 21 22 |
# File 'lib/elasticated/boolean_clause.rb', line 20 def add(condition) conditions << condition end |
#build ⇒ Object
34 35 36 |
# File 'lib/elasticated/boolean_clause.rb', line 34 def build conditions.map &:build end |
#build_first ⇒ Object
38 39 40 |
# File 'lib/elasticated/boolean_clause.rb', line 38 def build_first conditions.first.build end |
#count ⇒ Object
26 27 28 |
# File 'lib/elasticated/boolean_clause.rb', line 26 def count conditions.count end |
#empty? ⇒ Boolean
30 31 32 |
# File 'lib/elasticated/boolean_clause.rb', line 30 def empty? count == 0 end |
#fill_delimiter(field_delimiter) ⇒ Object
delimiters
14 15 16 |
# File 'lib/elasticated/boolean_clause.rb', line 14 def fill_delimiter(field_delimiter) conditions.each{ |condition| condition.fill_delimiter field_delimiter } end |