Class: God::TimedEvent
Direct Known Subclasses
Instance Attribute Summary collapse
-
#at ⇒ Object
Returns the value of attribute at.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #due? ⇒ Boolean
-
#initialize(delay = 0) ⇒ TimedEvent
constructor
Instantiate a new TimedEvent that will be triggered after the specified delay
delay
is the number of seconds from now at which to trigger.
Constructor Details
#initialize(delay = 0) ⇒ TimedEvent
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
11 12 13 |
# File 'lib/god/driver.rb', line 11 def initialize(delay = 0) self.at = Time.now + delay end |
Instance Attribute Details
#at ⇒ Object
Returns the value of attribute at.
5 6 7 |
# File 'lib/god/driver.rb', line 5 def at @at end |
Instance Method Details
#<=>(other) ⇒ Object
19 20 21 |
# File 'lib/god/driver.rb', line 19 def <=>(other) self.at <=> other.at end |
#due? ⇒ Boolean
15 16 17 |
# File 'lib/god/driver.rb', line 15 def due? Time.now >= self.at end |