Class: Taskinator::Executor

Inherits:
Object
  • Object
show all
Defined in:
lib/taskinator/executor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(definition, task = nil) ⇒ Executor

Returns a new instance of Executor.



7
8
9
10
11
12
13
14
# File 'lib/taskinator/executor.rb', line 7

def initialize(definition, task=nil)
  @definition = definition
  @task = task

  # include the module into the eigen class, so it is only for this instance
  eigen = class << self; self; end
  eigen.send(:include, definition)
end

Instance Attribute Details

#definitionObject (readonly)

Returns the value of attribute definition.



4
5
6
# File 'lib/taskinator/executor.rb', line 4

def definition
  @definition
end

#taskObject (readonly)

Returns the value of attribute task.



5
6
7
# File 'lib/taskinator/executor.rb', line 5

def task
  @task
end

Instance Method Details

#optionsObject



24
25
26
# File 'lib/taskinator/executor.rb', line 24

def options
  task.options if task
end

#process_uuidObject



16
17
18
# File 'lib/taskinator/executor.rb', line 16

def process_uuid
  task.process_uuid if task
end

#uuidObject



20
21
22
# File 'lib/taskinator/executor.rb', line 20

def uuid
  task.uuid if task
end