Class: ForemanStatistics::StatisticsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/foreman_statistics/statistics_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
# File 'app/controllers/foreman_statistics/statistics_controller.rb', line 5

def index
  render :json => { :charts => charts.map(&:metadata) }
end

#showObject



9
10
11
# File 'app/controllers/foreman_statistics/statistics_controller.rb', line 9

def show
  render :json => @stat..merge(:data => @stat.calculate.map(&:values))
end