class Druid::BooleanFilter

Public Instance Methods

!() click to toggle source
# 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) click to toggle source
# 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) click to toggle source
# 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