1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activejob/lib/active_job/configured_job.rb

18 lines
353 B
Ruby
Raw Normal View History

2017-07-09 13:49:52 -04:00
# frozen_string_literal: true
2014-08-25 10:34:50 -04:00
module ActiveJob
class ConfiguredJob #:nodoc:
def initialize(job_class, options = {})
2014-08-25 10:34:50 -04:00
@options = options
@job_class = job_class
end
def perform_now(*args)
@job_class.new(*args).perform_now
end
def perform_later(*args)
@job_class.new(*args).enqueue @options
end
end
end