Class: Druid::HavingOperator

Inherits:
HavingFilter show all
Defined in:
lib/druid/having.rb

Instance Method Summary collapse

Methods inherited from HavingFilter

#clause?, #operator?

Methods included from Serializable

#as_json, #to_json, #to_s

Constructor Details

#initialize(type) ⇒ HavingOperator

Returns a new instance of HavingOperator.



49
50
51
52
# File 'lib/druid/having.rb', line 49

def initialize(type)
  @type = type
  @elements = []
end

Instance Method Details

#add(element) ⇒ Object



58
59
60
# File 'lib/druid/having.rb', line 58

def add(element)
  @elements << element
end

#and?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/druid/having.rb', line 54

def and?
  @type == 'and'
end

#to_hashObject



62
63
64
65
66
67
# File 'lib/druid/having.rb', line 62

def to_hash
  {
    :type => @type,
    :havingSpecs => @elements
  }
end