Class: Rack::LocaleMemorable::Request

Inherits:
Request
  • Object
show all
Defined in:
lib/rack/locale_memorable/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#explicit_localeObject (readonly)

Returns the value of attribute explicit_locale.



6
7
8
# File 'lib/rack/locale_memorable/request.rb', line 6

def explicit_locale
  @explicit_locale
end

Instance Method Details

#detect_locale(params_key:, cookie_key:) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/rack/locale_memorable/request.rb', line 8

def detect_locale(params_key:, cookie_key:)
  (
    from_params(params_key) ||
    from_cookies(cookie_key) ||
    from_headers
  )
end