Class: God::DriverOperation

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(task, name, args) ⇒ DriverOperation

Returns a new instance of DriverOperation.



41
42
43
44
45
46
# File 'lib/god/driver.rb', line 41

def initialize(task, name, args)
  super(0)
  self.task = task
  self.name = name
  self.args = args
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



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

def args
  @args
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#taskObject

Returns the value of attribute task.



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

def task
  @task
end

Instance Method Details

#handle_eventObject

Handle the next queued operation that was issued asynchronously

Returns nothing



51
52
53
# File 'lib/god/driver.rb', line 51

def handle_event
  @task.send(@name, *@args)
end