Class: God::DriverEvent
- Inherits:
-
TimedEvent
- Object
- TimedEvent
- God::DriverEvent
- Defined in:
- lib/god/driver.rb
Overview
A DriverEvent is a TimedEvent with an associated Task and Condition. This is the primary mechanism for poll conditions to be scheduled.
Instance Attribute Summary
Attributes inherited from TimedEvent
Instance Method Summary collapse
-
#handle_event ⇒ Object
Handle this event by invoking the underlying condition on the associated task.
-
#initialize(delay, task, condition) ⇒ DriverEvent
constructor
Initialize a new DriverEvent.
Methods inherited from TimedEvent
Constructor Details
#initialize(delay, task, condition) ⇒ DriverEvent
Initialize a new DriverEvent.
delay - The Numeric delay for this event. task - The Task associated with this event. condition - The Condition associated with this event.
53 54 55 56 57 |
# File 'lib/god/driver.rb', line 53 def initialize(delay, task, condition) super(delay) @task = task @condition = condition end |
Instance Method Details
#handle_event ⇒ Object
Handle this event by invoking the underlying condition on the associated task.
Returns nothing.
63 64 65 |
# File 'lib/god/driver.rb', line 63 def handle_event @task.handle_poll(@condition) end |