Class: Rack::LocaleMemorable::Response
- Inherits:
-
Response
- Object
- Response
- Rack::LocaleMemorable::Response
- Defined in:
- lib/rack/locale_memorable/response.rb
Instance Method Summary collapse
- #finish ⇒ Object
- #remember_locale(explicit_locale, key:, lifetime: 1.year, domain: nil, path: '/', http_only: true, secure: true) ⇒ Object
Instance Method Details
#finish ⇒ Object
17 18 19 20 |
# File 'lib/rack/locale_memorable/response.rb', line 17 def finish headers['Content-Language'] ||= I18n.locale.to_s super end |
#remember_locale(explicit_locale, key:, lifetime: 1.year, domain: nil, path: '/', http_only: true, secure: true) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/rack/locale_memorable/response.rb', line 6 def remember_locale(explicit_locale, key:, lifetime: 1.year, domain: nil, path: '/', http_only: true, secure: true) key, { value: explicit_locale, expires: lifetime.from_now, domain: domain, path: path, http_only: http_only, secure: secure }.compact end |