Class: Workhorse::Jobs::RunActiveJob

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(job_data) ⇒ RunActiveJob

Returns a new instance of RunActiveJob.



5
6
7
# File 'lib/workhorse/jobs/run_active_job.rb', line 5

def initialize(job_data)
  @job_data = job_data
end

Instance Attribute Details

#job_dataObject (readonly)

Returns the value of attribute job_data.



3
4
5
# File 'lib/workhorse/jobs/run_active_job.rb', line 3

def job_data
  @job_data
end

Instance Method Details

#job_classObject



9
10
11
# File 'lib/workhorse/jobs/run_active_job.rb', line 9

def job_class
  @job_data['job_class'].safe_constantize
end

#performObject



13
14
15
# File 'lib/workhorse/jobs/run_active_job.rb', line 13

def perform
  ActiveJob::Base.execute(@job_data)
end