Class: God::DriverEvent

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

Overview

DriverEvent

Instance Attribute Summary collapse

Attributes inherited from TimedEvent

#at

Instance Method Summary collapse

Methods inherited from TimedEvent

#<=>, #due?

Constructor Details

#initialize(delay, task, condition) ⇒ DriverEvent

Returns a new instance of DriverEvent.



34
35
36
37
38
# File 'lib/god/driver.rb', line 34

def initialize(delay, task, condition)
  super delay
  self.task = task
  self.condition = condition
end

Instance Attribute Details

#conditionObject

Returns the value of attribute condition.



32
33
34
# File 'lib/god/driver.rb', line 32

def condition
  @condition
end

#taskObject

Returns the value of attribute task.



32
33
34
# File 'lib/god/driver.rb', line 32

def task
  @task
end

Instance Method Details

#handle_eventObject



40
41
42
# File 'lib/god/driver.rb', line 40

def handle_event
  @task.handle_poll(@condition)
end