Class: SimpleApm::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/simple_apm/application_controller.rb

Direct Known Subclasses

ApmController

Constant Summary collapse

AVAILABLE_LOCALES =
%w[en zh-CN].freeze

Instance Method Summary collapse

Instance Method Details

#apm_dateObject



9
10
11
# File 'app/controllers/simple_apm/application_controller.rb', line 9

def apm_date
  session[:apm_date].presence || Time.now.strftime("%Y-%m-%d")
end

#simple_apm_localeObject



13
14
15
16
# File 'app/controllers/simple_apm/application_controller.rb', line 13

def simple_apm_locale
  locale = session[:simple_apm_locale].presence
  AVAILABLE_LOCALES.include?(locale) ? locale : "en"
end