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
18 19 20 |
# File 'lib/god/driver.rb', line 18 def initialize(delay = 0) self.at = Time.now + delay end |
Instance Attribute Details
#at ⇒ Object
Returns the value of attribute at.
12 13 14 |
# File 'lib/god/driver.rb', line 12 def at @at end |
Instance Method Details
#<=>(other) ⇒ Object
26 27 28 |
# File 'lib/god/driver.rb', line 26 def <=>(other) self.at <=> other.at end |
#due? ⇒ Boolean
22 23 24 |
# File 'lib/god/driver.rb', line 22 def due? Time.now >= self.at end |