Class: Delayed::JobWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/delayed/active_job_adapter.rb

Overview

rubocop:disable Betterment/ActiveJobPerformable

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(job_data) ⇒ JobWrapper

Returns a new instance of JobWrapper.



45
46
47
# File 'lib/delayed/active_job_adapter.rb', line 45

def initialize(job_data)
  @job_data = job_data
end

Instance Attribute Details

#job_dataObject

Returns the value of attribute job_data.



41
42
43
# File 'lib/delayed/active_job_adapter.rb', line 41

def job_data
  @job_data
end

Instance Method Details

#display_nameObject



49
50
51
# File 'lib/delayed/active_job_adapter.rb', line 49

def display_name
  job_data['job_class']
end

#encode_with(coder) ⇒ Object



59
60
61
# File 'lib/delayed/active_job_adapter.rb', line 59

def encode_with(coder)
  coder['job_data'] = @job_data
end

#performObject



53
54
55
56
57
# File 'lib/delayed/active_job_adapter.rb', line 53

def perform
  ActiveJob::Callbacks.run_callbacks(:execute) do
    job.perform_now
  end
end