Class: Wurk::Middleware::I18n::Server
- Inherits:
-
Object
- Object
- Wurk::Middleware::I18n::Server
- Includes:
- ServerMiddleware
- Defined in:
- lib/wurk/middleware/i18n.rb
Overview
Server: scopes the job execution to the captured locale. Restores the previous value on the way out so middleware stacking doesn't leak across jobs in the same thread.
Instance Attribute Summary collapse
-
#config ⇒ Object
included
from ServerMiddleware
Returns the value of attribute config.
Instance Method Summary collapse
- #call(_job_instance, job, _queue) ⇒ 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_instance, job, _queue) ⇒ Object
54 55 56 |
# File 'lib/wurk/middleware/i18n.rb', line 54 def call(_job_instance, job, _queue, &) I18n.with_locale(job['locale'], &) end |