Class: Bfire::Metric
- Inherits:
-
Object
- Object
- Bfire::Metric
- Defined in:
- lib/bfire/metric.rb
Instance Method Summary collapse
-
#initialize(name, results, opts = {}) ⇒ Metric
constructor
A new instance of Metric.
- #values ⇒ Object
Constructor Details
#initialize(name, results, opts = {}) ⇒ Metric
Returns a new instance of Metric.
19 20 21 22 23 |
# File 'lib/bfire/metric.rb', line 19 def initialize(name, results, opts = {}) @name = name @results = results @opts = opts end |
Instance Method Details
#values ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/bfire/metric.rb', line 25 def values @results.map{|r| case @opts[:type] when :numeric r['value'].to_f else r['value'] end }.reverse end |