Class: RunThisAsync::AsyncPlan
- Inherits:
- BasicObject
- Defined in:
- lib/run_this_async.rb
Instance Method Summary collapse
- #async ⇒ Object
-
#initialize(callee, expected_job_id) ⇒ AsyncPlan
constructor
A new instance of AsyncPlan.
- #method_missing(name, *args) ⇒ Object
Constructor Details
#initialize(callee, expected_job_id) ⇒ AsyncPlan
Returns a new instance of AsyncPlan.
12 13 14 15 16 17 |
# File 'lib/run_this_async.rb', line 12 def initialize(callee, expected_job_id) @callee = callee.is_a?(::Class) ? callee.to_s : callee @expected_job_id = expected_job_id @methods_to_call = [] @with_args = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/run_this_async.rb', line 25 def method_missing(name, *args) @methods_to_call << name @with_args << args self end |
Instance Method Details
#async ⇒ Object
19 20 21 22 23 |
# File 'lib/run_this_async.rb', line 19 def async ::RunThisAsync::AsyncRunner.perform_async( @expected_job_id, @callee, @methods_to_call, @with_args ) end |