Class: Delayed::JobWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/delayed/job_wrapper.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.



7
8
9
# File 'lib/delayed/job_wrapper.rb', line 7

def initialize(job_data)
  @job_data = job_data
end

Instance Attribute Details

#job_dataObject

Returns the value of attribute job_data.



3
4
5
# File 'lib/delayed/job_wrapper.rb', line 3

def job_data
  @job_data
end

Instance Method Details

#display_nameObject



11
12
13
# File 'lib/delayed/job_wrapper.rb', line 11

def display_name
  job_data['job_class']
end

#encode_with(coder) ⇒ Object



21
22
23
# File 'lib/delayed/job_wrapper.rb', line 21

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

#performObject



15
16
17
18
19
# File 'lib/delayed/job_wrapper.rb', line 15

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