Class: Rollbar::Delayed::JobData

Inherits:
Object
  • Object
show all
Defined in:
lib/rollbar/plugins/delayed_job/job_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(job) ⇒ JobData

Returns a new instance of JobData.



6
7
8
# File 'lib/rollbar/plugins/delayed_job/job_data.rb', line 6

def initialize(job)
  @job = job
end

Instance Attribute Details

#jobObject (readonly)

Returns the value of attribute job.



4
5
6
# File 'lib/rollbar/plugins/delayed_job/job_data.rb', line 4

def job
  @job
end

Instance Method Details

#to_hashObject



10
11
12
13
14
15
16
17
# File 'lib/rollbar/plugins/delayed_job/job_data.rb', line 10

def to_hash
  job_data = extract_job_data

  handler_parent = job_data['job'] || job_data
  handler_parent['handler'] = handler_data

  job_data
end