Class: Task::Tasks::CompositeTask

Inherits:
Object
  • Object
show all
Includes:
Task::Task
Defined in:
lib/task/tasks/composite_task.rb

Instance Method Summary collapse

Methods included from Task::Task

all, #as_hash, #complete, find, from_hash, interface, #save

Instance Method Details

#execute(opts = {}) ⇒ Array

Returns The sequence of return values from each task execution.

Parameters:

  • opts (Hash) (defaults to: {})

    Options to pass to the execute method of each child task

Returns:

  • (Array)

    The sequence of return values from each task execution



11
12
13
14
15
16
17
# File 'lib/task/tasks/composite_task.rb', line 11

def execute(opts = {})
  (Task::Task.all(child_task_list).map do |task|
    task_result = task.execute(opts)
    task.complete
    task_result
   end).force
end