Class: MetricsApi::V3::Presenters::DailyMetric
- Inherits:
-
Object
- Object
- MetricsApi::V3::Presenters::DailyMetric
- Defined in:
- app/services/metrics_api/v3/presenters/daily_metric.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(daily_metric) ⇒ DailyMetric
constructor
A new instance of DailyMetric.
- #to_json ⇒ Object
Constructor Details
#initialize(daily_metric) ⇒ DailyMetric
Returns a new instance of DailyMetric.
6 7 8 |
# File 'app/services/metrics_api/v3/presenters/daily_metric.rb', line 6 def initialize(daily_metric) @dm = daily_metric end |
Class Method Details
.to_proc ⇒ Object
17 18 19 |
# File 'app/services/metrics_api/v3/presenters/daily_metric.rb', line 17 def self.to_proc ->(metric) { new(metric).to_json } end |
Instance Method Details
#to_json ⇒ Object
10 11 12 13 14 15 |
# File 'app/services/metrics_api/v3/presenters/daily_metric.rb', line 10 def to_json { day: @dm.date, total_public_sets: @dm.total_public_sets } end |