Class: ActiveJob::ConfiguredJob

Inherits:
Object
  • Object
show all
Defined in:
lib/active_job/configured_job.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(job_class, options = {}) ⇒ ConfiguredJob

Returns a new instance of ConfiguredJob.



3
4
5
6
# File 'lib/active_job/configured_job.rb', line 3

def initialize(job_class, options={})
  @options = options
  @job_class = job_class
end

Instance Method Details

#perform_later(*args) ⇒ Object



12
13
14
# File 'lib/active_job/configured_job.rb', line 12

def perform_later(*args)
  @job_class.new(*args).enqueue @options
end

#perform_now(*args) ⇒ Object



8
9
10
# File 'lib/active_job/configured_job.rb', line 8

def perform_now(*args)
  @job_class.new(*args).perform_now
end