Class: QueryParam
- Inherits:
-
Object
- Object
- QueryParam
- Defined in:
- lib/opentsdb/query_param.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#aggregator ⇒ Object
Returns the value of attribute aggregator.
-
#downsample ⇒ Object
Returns the value of attribute downsample.
-
#end_time ⇒ Object
Returns the value of attribute end_time.
-
#interval ⇒ Object
Returns the value of attribute interval.
-
#metric ⇒ Object
Returns the value of attribute metric.
-
#queries ⇒ Object
writeonly
Sets the attribute queries.
-
#rate ⇒ Object
Returns the value of attribute rate.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
-
#tags ⇒ Object
Returns the value of attribute tags.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ QueryParam
constructor
A new instance of QueryParam.
- #to_json ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ QueryParam
6 7 8 9 10 11 |
# File 'lib/opentsdb/query_param.rb', line 6 def initialize( = {}) @aggregator = [:aggregator] @rate = [:rate] || false @metric = [:metric] @tags = [:tags] || {} end |
Instance Attribute Details
#aggregator ⇒ Object
Returns the value of attribute aggregator.
3 4 5 |
# File 'lib/opentsdb/query_param.rb', line 3 def aggregator @aggregator end |
#downsample ⇒ Object
Returns the value of attribute downsample.
3 4 5 |
# File 'lib/opentsdb/query_param.rb', line 3 def downsample @downsample end |
#end_time ⇒ Object
Returns the value of attribute end_time.
4 5 6 |
# File 'lib/opentsdb/query_param.rb', line 4 def end_time @end_time end |
#interval ⇒ Object
Returns the value of attribute interval.
3 4 5 |
# File 'lib/opentsdb/query_param.rb', line 3 def interval @interval end |
#metric ⇒ Object
Returns the value of attribute metric.
3 4 5 |
# File 'lib/opentsdb/query_param.rb', line 3 def metric @metric end |
#queries=(value) ⇒ Object
Sets the attribute queries
4 5 6 |
# File 'lib/opentsdb/query_param.rb', line 4 def queries=(value) @queries = value end |
#rate ⇒ Object
Returns the value of attribute rate.
3 4 5 |
# File 'lib/opentsdb/query_param.rb', line 3 def rate @rate end |
#start_time ⇒ Object
Returns the value of attribute start_time.
4 5 6 |
# File 'lib/opentsdb/query_param.rb', line 4 def start_time @start_time end |
#tags ⇒ Object
Returns the value of attribute tags.
3 4 5 |
# File 'lib/opentsdb/query_param.rb', line 3 def @tags end |
Instance Method Details
#to_json ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/opentsdb/query_param.rb', line 21 def to_json {}.tap do |h| h[:start] = start_time h[:end] = end_time h[:queries] = queries end.to_json end |