Class: Wurk::Middleware::I18n::Client
- Inherits:
-
Object
- Object
- Wurk::Middleware::I18n::Client
- Includes:
- ServerMiddleware
- Defined in:
- lib/wurk/middleware/i18n.rb
Overview
Client: writes the current locale into the outgoing job hash before
push. Idempotent — a caller-supplied "locale" is preserved.
No-op when I18n isn't loaded (don't introduce a nil "locale" key:
adding it would change the wire shape for callers without I18n).
Instance Attribute Summary collapse
-
#config ⇒ Object
included
from ServerMiddleware
Returns the value of attribute config.
Instance Method Summary collapse
- #call(_job_class, job, _queue, _redis_pool) ⇒ Object
- #logger ⇒ Object included from ServerMiddleware
- #redis ⇒ Object included from ServerMiddleware
- #redis_pool ⇒ Object included from ServerMiddleware
Instance Attribute Details
#config ⇒ Object Originally defined in module ServerMiddleware
Returns the value of attribute config.
Instance Method Details
#call(_job_class, job, _queue, _redis_pool) ⇒ Object
41 42 43 44 45 |
# File 'lib/wurk/middleware/i18n.rb', line 41 def call(_job_class, job, _queue, _redis_pool) current = I18n.current_locale job['locale'] ||= current if current yield end |