Class: Boar::Handlers::Locale
- Defined in:
- app/models/boar/handlers/locale.rb
Instance Attribute Summary collapse
-
#locale_param ⇒ Object
readonly
Returns the value of attribute locale_param.
Attributes inherited from Generic
Instance Method Summary collapse
- #call(*_) ⇒ Object
-
#initialize(service, options) ⇒ Locale
constructor
A new instance of Locale.
Methods included from Utils::Basic
#ensure_hash, #get_option, #interpolate
Constructor Details
#initialize(service, options) ⇒ Locale
Returns a new instance of Locale.
12 13 14 15 16 17 |
# File 'app/models/boar/handlers/locale.rb', line 12 def initialize(service, ) super(service) # Get the parameter @locale_param = self.get_option(, :locale_param, @configuration.locale_param) end |
Instance Attribute Details
#locale_param ⇒ Object (readonly)
Returns the value of attribute locale_param.
10 11 12 |
# File 'app/models/boar/handlers/locale.rb', line 10 def locale_param @locale_param end |
Instance Method Details
#call(*_) ⇒ Object
19 20 21 22 |
# File 'app/models/boar/handlers/locale.rb', line 19 def call(*_) # Retrieve locale from the controller's params. @service.controller.params[@locale_param].ensure_string end |