Class: Elasticated::BooleanClause
Instance Attribute Summary collapse
Instance Method Summary
collapse
#between, #boolean, #custom, #equal, #exists, #greater_equal, #greater_than, #less_equal, #less_than, #missing, #nested, #script, #wildcard, #with
#evaluate
Methods included from Clonable
#==, #clone
Constructor Details
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
#accept_visitor(visitor) ⇒ Object
14
15
16
|
# File 'lib/elasticated/boolean_clause.rb', line 14
def accept_visitor(visitor)
visitor.visit_boolean_clause(self)
end
|
#add(condition) ⇒ Object
28
29
30
|
# File 'lib/elasticated/boolean_clause.rb', line 28
def add(condition)
conditions << condition
end
|
#build ⇒ Object
42
43
44
|
# File 'lib/elasticated/boolean_clause.rb', line 42
def build
conditions.map &:build
end
|
#build_first ⇒ Object
46
47
48
|
# File 'lib/elasticated/boolean_clause.rb', line 46
def build_first
conditions.first.build
end
|
#count ⇒ Object
34
35
36
|
# File 'lib/elasticated/boolean_clause.rb', line 34
def count
conditions.count
end
|
#delimiters ⇒ Object
22
23
24
|
# File 'lib/elasticated/boolean_clause.rb', line 22
def delimiters
conditions.map(&:delimiter)
end
|
#empty? ⇒ Boolean
38
39
40
|
# File 'lib/elasticated/boolean_clause.rb', line 38
def empty?
count == 0
end
|
#fill_delimiter(field_delimiter) ⇒ Object
18
19
20
|
# File 'lib/elasticated/boolean_clause.rb', line 18
def fill_delimiter(field_delimiter)
conditions.each{ |condition| condition.fill_delimiter field_delimiter }
end
|