aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/lib/active_job/configured_job.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activejob/lib/active_job/configured_job.rb')
-rw-r--r--activejob/lib/active_job/configured_job.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/activejob/lib/active_job/configured_job.rb b/activejob/lib/active_job/configured_job.rb
new file mode 100644
index 0000000000..979280b910
--- /dev/null
+++ b/activejob/lib/active_job/configured_job.rb
@@ -0,0 +1,16 @@
+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
+
+ def perform_later(*args)
+ @job_class.new(*args).enqueue @options
+ end
+ end
+end