Class: Druid::HavingClause
- Inherits:
-
Object
- Object
- Druid::HavingClause
- Defined in:
- lib/druid/having.rb
Instance Method Summary collapse
- #<(value) ⇒ Object
- #>(value) ⇒ Object
- #as_json(*a) ⇒ Object
-
#initialize(metric) ⇒ HavingClause
constructor
A new instance of HavingClause.
- #to_hash ⇒ Object
- #to_json(*a) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(metric) ⇒ HavingClause
17 18 19 |
# File 'lib/druid/having.rb', line 17 def initialize(metric) @metric = metric end |
Instance Method Details
#<(value) ⇒ Object
21 22 23 24 25 |
# File 'lib/druid/having.rb', line 21 def <(value) @type = "lessThan" @value = value self end |
#>(value) ⇒ Object
27 28 29 30 31 |
# File 'lib/druid/having.rb', line 27 def >(value) @type = "greaterThan" @value = value self end |
#as_json(*a) ⇒ Object
37 38 39 |
# File 'lib/druid/having.rb', line 37 def as_json(*a) to_hash end |
#to_hash ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/druid/having.rb', line 45 def to_hash { :type => @type, :aggregation => @metric, :value => @value } end |
#to_json(*a) ⇒ Object
41 42 43 |
# File 'lib/druid/having.rb', line 41 def to_json(*a) to_hash.to_json(*a) end |
#to_s ⇒ Object
33 34 35 |
# File 'lib/druid/having.rb', line 33 def to_s to_hash.to_s end |