Class: Wicoris::Postman::Postman
- Inherits:
-
Object
- Object
- Wicoris::Postman::Postman
- Defined in:
- lib/wicoris/postman/postman.rb
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Postman
constructor
A new instance of Postman.
-
#run ⇒ Object
Process each job.
Constructor Details
#initialize(opts = {}) ⇒ Postman
Returns a new instance of Postman.
4 5 6 7 |
# File 'lib/wicoris/postman/postman.rb', line 4 def initialize(opts = {}) @opts = opts @logger = opts[:logger] end |
Instance Method Details
#run ⇒ Object
Process each job.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/wicoris/postman/postman.rb', line 10 def run jobs.each do |job| begin job.process rescue => e @logger.error(e) if @logger ensure job.clear! end end end |