Class: Processor::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/processor/runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(processor) ⇒ Runner

Returns a new instance of Runner.



3
4
5
# File 'lib/processor/runner.rb', line 3

def initialize(processor)
  @processor = processor
end

Instance Method Details

#run(process_runner) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/processor/runner.rb', line 7

def run(process_runner)
  processor.start
  process_runner.call processor
  processor.finish

rescue Exception => exception
  processor.error exception
  raise exception

ensure
  processor.finalize
end