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.
15 16 17 18 19 20 |
# File 'lib/run_this_async.rb', line 15 def initialize(callee, expected_job_id) @callee = ::RunThisAsync::Callee::Encoder.call(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
28 29 30 31 32 33 |
# File 'lib/run_this_async.rb', line 28 def method_missing(name, *args) @methods_to_call << name @with_args << args self end |
Instance Method Details
#async ⇒ Object
22 23 24 25 26 |
# File 'lib/run_this_async.rb', line 22 def async ::RunThisAsync::AsyncRunner.perform_async( @expected_job_id, @callee, @methods_to_call, @with_args ) end |