Class: RailsLocaleDetection::LocaleDetector
- Inherits:
-
Object
- Object
- RailsLocaleDetection::LocaleDetector
- Includes:
- DetectionMethods, LocaleAccessors
- Defined in:
- lib/rails_locale_detection/locale_detector.rb
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
Class Method Summary collapse
Instance Method Summary collapse
- #cookies ⇒ Object
-
#initialize(controller = nil) ⇒ LocaleDetector
constructor
A new instance of LocaleDetector.
- #locale_key ⇒ Object
Methods included from LocaleAccessors
#alternate_locales, #available_locales, #current_locale, #current_locale=, #default_locale
Methods included from DetectionMethods
#detect_locale, #locale_from, #locale_from_cookie, #locale_from_param, #locale_from_request, #locale_from_user, #set_default_url_option_for_request?, #set_locale, #validate_locale
Constructor Details
#initialize(controller = nil) ⇒ LocaleDetector
Returns a new instance of LocaleDetector.
12 13 14 |
# File 'lib/rails_locale_detection/locale_detector.rb', line 12 def initialize(controller = nil) @controller = controller end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
8 9 10 |
# File 'lib/rails_locale_detection/locale_detector.rb', line 8 def controller @controller end |
Class Method Details
.before(controller) ⇒ Object
24 25 26 |
# File 'lib/rails_locale_detection/locale_detector.rb', line 24 def self.before(controller) new(controller).set_locale end |
Instance Method Details
#cookies ⇒ Object
16 17 18 |
# File 'lib/rails_locale_detection/locale_detector.rb', line 16 def request. end |
#locale_key ⇒ Object
20 21 22 |
# File 'lib/rails_locale_detection/locale_detector.rb', line 20 def locale_key RailsLocaleDetection.locale_key end |