Class: Wurk::Middleware::I18n::Server

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#configObject 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

#loggerObject Originally defined in module ServerMiddleware

#redisObject Originally defined in module ServerMiddleware

#redis_poolObject Originally defined in module ServerMiddleware