Class: Mdash::AnnounceController

Inherits:
ApplicationController show all
Defined in:
app/controllers/mdash/announce_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/mdash/announce_controller.rb', line 3

def index
  metrics = Mdash.config.metrics.map { |metric|
    {
      name: metric.id,
      model: metric.model,
      aggregation: metric.aggregation,
      aggregation_field: metric.aggregation_field,
      period: metric.period,
      periods: metric.periods,
      modifier: metric.modifier
    }
  }

  render json: {
    site_name: Mdash.config.site_name,
    metrics: metrics
  }.as_json
end