Class: MaxPage::MetricsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/max_page/metrics_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/max_page/metrics_controller.rb', line 7

def index
  @title = MaxPage.config.title
  @metrics = MaxPage.config.metrics
  @metrics.each &:run
  @alright = @metrics.map(&:ok?).all? true
  if @alright
    @message = MaxPage.config.success_message
  else
    @message = MaxPage.config.warning_message
  end
  @metrics_without_group = @metrics.reject(&:group)
  @groups = MaxPage.config.groups
end