Class: Observed::SequenceTask

Inherits:
Task
  • Object
show all
Defined in:
lib/observed/task.rb

Instance Attribute Summary collapse

Attributes inherited from Task

#name

Instance Method Summary collapse

Methods inherited from Task

#compose, #then

Constructor Details

#initialize(base_task, next_task) ⇒ SequenceTask

Returns a new instance of SequenceTask.



46
47
48
49
# File 'lib/observed/task.rb', line 46

def initialize(base_task, next_task)
  @base_task = base_task
  @next_task = next_task
end

Instance Attribute Details

#base_taskObject (readonly)

Returns the value of attribute base_task.



45
46
47
# File 'lib/observed/task.rb', line 45

def base_task
  @base_task
end

Instance Method Details

#now(data = {}, options = nil) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/observed/task.rb', line 50

def now(data={}, options=nil)
  @base_task.now(data, options) do |data, options2|
    @next_task.now(data, (options2 || options)) do |data, options3|
      yield data, (options3 || options2 || options) if block_given?
    end
  end
end