Class: Druid::HavingOperator
Instance Attribute Summary
Attributes inherited from Having
#aggregation, #havingSpec, #havingSpecs, #type, #value
Instance Method Summary
collapse
Methods inherited from Having
#as_json, #chain, #clause?, #method_missing, #operator?
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Druid::Having
Instance Method Details
#! ⇒ Object
166
167
168
169
170
171
172
173
174
|
# File 'lib/druid/having.rb', line 166
def !
if @type == 'not'
@elements.first
else
operator = HavingOperator.new(type: 'not')
operator.havingSpec = self
operator
end
end
|
#&(other) ⇒ Object
158
159
160
|
# File 'lib/druid/having.rb', line 158
def &(other)
apply_operator('and', other)
end
|
#add(element) ⇒ Object
154
155
156
|
# File 'lib/druid/having.rb', line 154
def add(element)
@elements << element
end
|
#and? ⇒ Boolean
146
147
148
|
# File 'lib/druid/having.rb', line 146
def and?
@type == 'and'
end
|
#|(other) ⇒ Object
162
163
164
|
# File 'lib/druid/having.rb', line 162
def |(other)
apply_operator('or', other)
end
|