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.



27
28
29
30
31
# File 'lib/god/driver.rb', line 27

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

Instance Attribute Details

#conditionObject

Returns the value of attribute condition.



25
26
27
# File 'lib/god/driver.rb', line 25

def condition
  @condition
end

#taskObject

Returns the value of attribute task.



25
26
27
# File 'lib/god/driver.rb', line 25

def task
  @task
end

Instance Method Details

#handle_eventObject



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

def handle_event
  @task.handle_poll(@condition)
end