class Druid::HavingClause

Public Instance Methods

!() click to toggle source
# File lib/druid/having.rb, line 101
def !
  create_operator('not')
end
&(other) click to toggle source
# File lib/druid/having.rb, line 93
def &(other)
  create_operator('and', other)
end
'!='(value)
Alias for: neq
'=='(value)
Alias for: eq
<(value) click to toggle source
# File lib/druid/having.rb, line 117
def <(value)
  set_clause('lessThan', value)
end
>(value) click to toggle source
# File lib/druid/having.rb, line 121
def >(value)
  set_clause('greaterThan', value)
end
eq(value) click to toggle source
# File lib/druid/having.rb, line 105
def eq(value)
  set_clause('equalTo', value)
end
Also aliased as: '=='
neq(value) click to toggle source
# File lib/druid/having.rb, line 111
def neq(value)
  !eq(value)
end
Also aliased as: '!='
|(other) click to toggle source
# File lib/druid/having.rb, line 97
def |(other)
  create_operator('or', other)
end

Private Instance Methods

create_operator(type, other = nil) click to toggle source
# File lib/druid/having.rb, line 127
def create_operator(type, other = nil)
  operator = HavingOperator.new(type: type)
  if type.to_s == 'not'
    operator.havingSpec = self
  else
    operator.havingSpecs << self
    operator.havingSpecs << other if other
  end
  operator
end
set_clause(type, value) click to toggle source
# File lib/druid/having.rb, line 138
def set_clause(type, value)
  @type = type
  @value = value
  self
end