Class: God::DriverOperation
- Inherits:
-
TimedEvent
- Object
- TimedEvent
- God::DriverOperation
- Defined in:
- lib/god/driver.rb
Overview
A DriverOperation is a TimedEvent that is due as soon as possible. It is used to execute an arbitrary method on the associated Task.
Instance Attribute Summary
Attributes inherited from TimedEvent
Instance Method Summary collapse
-
#handle_event ⇒ Object
Handle the operation that was issued asynchronously.
-
#initialize(task, name, args) ⇒ DriverOperation
constructor
Initialize a new DriverOperation.
Methods inherited from TimedEvent
Constructor Details
#initialize(task, name, args) ⇒ DriverOperation
Initialize a new DriverOperation.
task - The Task upon which to operate. name - The Symbol name of the method to call. args - The Array of arguments to send to the method.
76 77 78 79 80 81 |
# File 'lib/god/driver.rb', line 76 def initialize(task, name, args) super(0) @task = task @name = name @args = args end |
Instance Method Details
#handle_event ⇒ Object
Handle the operation that was issued asynchronously.
Returns nothing.
86 87 88 |
# File 'lib/god/driver.rb', line 86 def handle_event @task.send(@name, *@args) end |