Class: ATP::Processors::FlowID
- Inherits:
-
ATP::Processor
- Object
- ATP::Processor
- ATP::Processors::FlowID
- Defined in:
- lib/atp/processors/flow_id.rb
Overview
Adds the flow ID to all ids and label names
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #on_id(node) ⇒ Object
- #on_test_result(node) ⇒ Object (also: #on_test_executed)
- #run(node, id) ⇒ Object
Methods inherited from ATP::Processor
#handler_missing, #n, #n0, #n1, #process
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/atp/processors/flow_id.rb', line 5 def id @id end |
Instance Method Details
#on_id(node) ⇒ Object
12 13 14 |
# File 'lib/atp/processors/flow_id.rb', line 12 def on_id(node) node.updated(nil, ["#{node.value}_#{id}"]) end |
#on_test_result(node) ⇒ Object Also known as: on_test_executed
16 17 18 19 20 21 22 23 24 |
# File 'lib/atp/processors/flow_id.rb', line 16 def on_test_result(node) tid, state, nodes = *node if tid.is_a?(Array) tid = tid.map { |tid| "#{tid}_#{id}" } else tid = "#{tid}_#{id}" end node.updated(nil, [tid, state] + [process(nodes)]) end |
#run(node, id) ⇒ Object
7 8 9 10 |
# File 'lib/atp/processors/flow_id.rb', line 7 def run(node, id) @id = id process(node) end |