Class: Jobs::BaseJob

Inherits:
Object
  • Object
show all
Defined in:
lib/jobs/base_job.rb

Instance Method Summary collapse

Constructor Details

#initializeBaseJob

Returns a new instance of BaseJob.



10
# File 'lib/jobs/base_job.rb', line 10

def initialize(); end

Instance Method Details

#execute(context) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/jobs/base_job.rb', line 12

def execute(context)
  begin
    perform_job
  rescue Exception => e
    raise JobError.new(e)
  end
end

#perform_jobObject



20
21
22
# File 'lib/jobs/base_job.rb', line 20

def perform_job
  raise "Subclass must implement the perform job method"
end