Class: God::TimedEvent
- Inherits:
-
Object
- Object
- God::TimedEvent
- Includes:
- Comparable
- Defined in:
- lib/god/driver.rb
Direct Known Subclasses
Instance Attribute Summary (collapse)
-
- (Object) at
Returns the value of attribute at.
Instance Method Summary (collapse)
- - (Object) <=>(other)
- - (Boolean) due?
-
- (TimedEvent) initialize(delay = 0)
constructor
Instantiate a new TimedEvent that will be triggered after the specified delay.
Constructor Details
- (TimedEvent) initialize(delay = 0)
Instantiate a new TimedEvent that will be triggered after the specified delay
+delay+ is the number of seconds from now at which to trigger
Returns TimedEvent
18 19 20 |
# File 'lib/god/driver.rb', line 18 def initialize(delay = 0) self.at = Time.now + delay end |
Instance Attribute Details
- (Object) at
Returns the value of attribute at
12 13 14 |
# File 'lib/god/driver.rb', line 12 def at @at end |
Instance Method Details
- (Object) <=>(other)
26 27 28 |
# File 'lib/god/driver.rb', line 26 def <=>(other) self.at <=> other.at end |
- (Boolean) due?
22 23 24 |
# File 'lib/god/driver.rb', line 22 def due? Time.now >= self.at end |