Class: Toro::Middleware::Server::Properties

Inherits:
Object
  • Object
show all
Defined in:
lib/toro/middleware/server/properties.rb

Instance Method Summary collapse

Instance Method Details

#call(job, worker) ⇒ Object


5
6
7
8
9
10
11
# File 'lib/toro/middleware/server/properties.rb', line 5

def call(job, worker)
  result = yield
  if result.is_a?(Hash) && result[:job_properties].is_a?(Hash)
    job.set_properties(result[:job_properties])
    job.save
  end
end