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.
10 11 12 |
# File 'lib/rails_locale_detection/locale_detector.rb', line 10 def initialize(controller = nil) @controller = controller end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
6 7 8 |
# File 'lib/rails_locale_detection/locale_detector.rb', line 6 def controller @controller end |
Class Method Details
.before(controller) ⇒ Object
22 23 24 |
# File 'lib/rails_locale_detection/locale_detector.rb', line 22 def self.before(controller) new(controller).set_locale end |
Instance Method Details
#cookies ⇒ Object
14 15 16 |
# File 'lib/rails_locale_detection/locale_detector.rb', line 14 def request. end |
#locale_key ⇒ Object
18 19 20 |
# File 'lib/rails_locale_detection/locale_detector.rb', line 18 def locale_key RailsLocaleDetection.locale_key end |