Class: God::DriverEvent
- Inherits:
-
Object
- Object
- God::DriverEvent
- Defined in:
- lib/god/driver.rb
Instance Attribute Summary collapse
-
#at ⇒ Object
Returns the value of attribute at.
-
#condition ⇒ Object
Returns the value of attribute condition.
Instance Method Summary collapse
- #due? ⇒ Boolean
-
#initialize(condition, delay) ⇒ DriverEvent
constructor
Instantiate a new TimerEvent that will be triggered after the specified delay
condition
is the Conditiondelay
is the number of seconds from now at which to trigger.
Constructor Details
#initialize(condition, delay) ⇒ DriverEvent
Instantiate a new TimerEvent that will be triggered after the specified delay
+condition+ is the Condition
+delay+ is the number of seconds from now at which to trigger
Returns TimerEvent
11 12 13 14 |
# File 'lib/god/driver.rb', line 11 def initialize(condition, delay) self.condition = condition self.at = Time.now + delay end |
Instance Attribute Details
#at ⇒ Object
Returns the value of attribute at.
4 5 6 |
# File 'lib/god/driver.rb', line 4 def at @at end |
#condition ⇒ Object
Returns the value of attribute condition.
4 5 6 |
# File 'lib/god/driver.rb', line 4 def condition @condition end |
Instance Method Details
#due? ⇒ Boolean
16 17 18 |
# File 'lib/god/driver.rb', line 16 def due? Time.now >= self.at end |