Class: MetricsCapacitor::Model::Metrics
- Inherits:
-
Object
- Object
- MetricsCapacitor::Model::Metrics
- Extended by:
- Forwardable
- Defined in:
- lib/metrics-capacitor/model/metrics.rb
Instance Method Summary collapse
-
#initialize(data = []) ⇒ Metrics
constructor
A new instance of Metrics.
- #proc_by_slices!(n) ⇒ Object
- #to_elastic ⇒ Object
- #to_redis ⇒ Object
Constructor Details
Instance Method Details
#proc_by_slices!(n) ⇒ Object
12 13 14 |
# File 'lib/metrics-capacitor/model/metrics.rb', line 12 def proc_by_slices!(n) @metrics.each_slice(n) { |s| yield Metrics.new(s) } end |
#to_elastic ⇒ Object
16 17 18 |
# File 'lib/metrics-capacitor/model/metrics.rb', line 16 def to_elastic @metrics.map(&:to_elastic) end |
#to_redis ⇒ Object
20 21 22 |
# File 'lib/metrics-capacitor/model/metrics.rb', line 20 def to_redis @metrics.map(&:to_redis) end |