Class: God::DriverEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/god/driver.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#atObject

Returns the value of attribute at.



4
5
6
# File 'lib/god/driver.rb', line 4

def at
  @at
end

#conditionObject

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

Returns:

  • (Boolean)


16
17
18
# File 'lib/god/driver.rb', line 16

def due?
  Time.now >= self.at
end