Class: Druid::BooleanFilter
Instance Attribute Summary
Attributes inherited from Filter
#dimension, #field, #fields, #function, #pattern, #type, #value
Instance Method Summary
collapse
Methods inherited from Filter
#as_json, #method_missing
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Druid::Filter
Instance Method Details
#! ⇒ Object
272
273
274
275
276
277
278
279
280
281
282
|
# File 'lib/druid/filter.rb', line 272
def !()
if @type.to_s == 'not'
self.field
self
else
BooleanFilter.new({
type: 'not',
field: self,
})
end
end
|
#&(other) ⇒ Object
248
249
250
251
252
253
254
255
256
257
258
|
# File 'lib/druid/filter.rb', line 248
def &(other)
if @type.to_s == 'and'
self.fields << other
self
else
BooleanFilter.new({
type: 'and',
fields: [self, other],
})
end
end
|
#|(other) ⇒ Object
260
261
262
263
264
265
266
267
268
269
270
|
# File 'lib/druid/filter.rb', line 260
def |(other)
if @type.to_s == 'or'
self.fields << other
self
else
BooleanFilter.new({
type: 'or',
fields: [self, other],
})
end
end
|