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
2020-01-21 09:23:15 +09:00

20 lines
498 B
Ruby

# frozen_string_literal: true
module ActiveJob
class ConfiguredJob #:nodoc:
def initialize(job_class, options = {})
@options = options
@job_class = job_class
end
def perform_now(*args)
@job_class.new(*args).perform_now
end
ruby2_keywords(:perform_now) if respond_to?(:ruby2_keywords, true)
def perform_later(*args)
@job_class.new(*args).enqueue @options
end
ruby2_keywords(:perform_later) if respond_to?(:ruby2_keywords, true)
end
end