Class: Druid::HavingClause
Instance Method Summary
collapse
#clause?, #operator?
#as_json, #to_json, #to_s
Constructor Details
Returns a new instance of HavingClause.
23
24
25
|
# File 'lib/druid/having.rb', line 23
def initialize(metric)
@metric = metric
end
|
Instance Method Details
#<(value) ⇒ Object
27
28
29
30
31
|
# File 'lib/druid/having.rb', line 27
def <(value)
@type = "lessThan"
@value = value
self
end
|
#>(value) ⇒ Object
33
34
35
36
37
|
# File 'lib/druid/having.rb', line 33
def >(value)
@type = "greaterThan"
@value = value
self
end
|
#to_hash ⇒ Object
39
40
41
42
43
44
45
|
# File 'lib/druid/having.rb', line 39
def to_hash
{
:type => @type,
:aggregation => @metric,
:value => @value
}
end
|