Module: Tap::App::Node

Included in:
Tap::App, Task
Defined in:
lib/tap/app/node.rb

Overview

Node adds the node API to objects responding to call. Additional helper methods are added to simplify the construction of workflows; they are not required by the API.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#joinsObject

The joins called when call completes



10
11
12
# File 'lib/tap/app/node.rb', line 10

def joins
  @joins
end

Class Method Details

.extended(obj) ⇒ Object

Sets up required variables for extended objects.



18
19
20
# File 'lib/tap/app/node.rb', line 18

def self.extended(obj) # :nodoc:
  obj.instance_variable_set(:@joins, [])
end

.intern(&block) ⇒ Object

Interns a new node by extending the block with Node.



13
14
15
# File 'lib/tap/app/node.rb', line 13

def self.intern(&block)
  block.extend self
end

Instance Method Details

#on_complete(&block) ⇒ Object

Sets the block as a join for self.



23
24
25
26
# File 'lib/tap/app/node.rb', line 23

def on_complete(&block) # :yields: result
  self.joins << block if block
  self
end