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.



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

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.



46
47
48
# File 'lib/god/driver.rb', line 46

def args
  @args
end

#nameObject

Returns the value of attribute name.



46
47
48
# File 'lib/god/driver.rb', line 46

def name
  @name
end

#taskObject

Returns the value of attribute task.



46
47
48
# File 'lib/god/driver.rb', line 46

def task
  @task
end

Instance Method Details

#handle_eventObject

Handle the next queued operation that was issued asynchronously

Returns nothing



58
59
60
# File 'lib/god/driver.rb', line 58

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