123456789_123456789_123456789_123456789_123456789_

Class: ActiveJob::QueueAdapters::DelayedJobAdapter::JobWrapper

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(job_data) ⇒ JobWrapper

[ GitHub ]

  
# File 'activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb', line 34

def initialize(job_data)
  @job_data = job_data
end

Instance Attribute Details

#job_data (rw)

[ GitHub ]

  
# File 'activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb', line 32

attr_accessor :job_data

#log_arguments?Boolean (readonly, private)

[ GitHub ]

  
# File 'activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb', line 51

def log_arguments?
  job_data["job_class"].constantize.log_arguments?
rescue NameError
  false
end

Instance Method Details

#display_name

[ GitHub ]

  
# File 'activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb', line 38

def display_name
  base_name = "#{job_data["job_class"]} [#{job_data["job_id"]}] from DelayedJob(#{job_data["queue_name"]})"

  return base_name unless log_arguments?

  "#{base_name} with arguments: #{job_data["arguments"]}"
end

#perform

[ GitHub ]

  
# File 'activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb', line 46

def perform
  Base.execute(job_data)
end