Class: Lev::ActiveJob::ConfiguredJob

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(routine_class, options) ⇒ ConfiguredJob

Returns a new instance of ConfiguredJob.



6
7
8
9
# File 'lib/lev/active_job/configured_job.rb', line 6

def initialize(routine_class, options)
  @routine_class = routine_class
  @options = options
end

Instance Attribute Details

#routine_classObject (readonly)

Returns the value of attribute routine_class.



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

def routine_class
  @routine_class
end

Instance Method Details

#optionsObject



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

def options
  routine_class.active_job_enqueue_options.merge(@options)
end

#perform_later(*args, **kwargs, &block) ⇒ Object



15
16
17
# File 'lib/lev/active_job/configured_job.rb', line 15

def perform_later(*args, **kwargs, &block)
  routine_class.job_class.new.perform_later(routine_class, options, *args, **kwargs, &block)
end