Class: Ripe::Blocks::ParallelBlock
- Inherits:
-
MultiBlock
- Object
- Block
- MultiBlock
- Ripe::Blocks::ParallelBlock
- Defined in:
- lib/ripe/blocks/parallel_block.rb
Overview
This class represents a parallel composition of blocks, in that the children blocks of an instance of this class are to be run in parallel.
Instance Attribute Summary
Attributes inherited from Block
Instance Method Summary collapse
-
#command ⇒ String
Return the string command of the subtree starting at the current block.
-
#initialize(*blocks) ⇒ ParallelBlock
constructor
Create a new, empty ParallelBlock.
Methods inherited from MultiBlock
#prune, #targets_exist?, #topology
Methods inherited from Block
#+, #prune, #targets_exist?, #topology, #|
Constructor Details
#initialize(*blocks) ⇒ ParallelBlock
Create a new, empty Ripe::Blocks::ParallelBlock.
16 17 18 |
# File 'lib/ripe/blocks/parallel_block.rb', line 16 def initialize(*blocks) super(:|, *blocks) end |
Instance Method Details
#command ⇒ String
Return the string command of the subtree starting at the current block.
23 24 25 |
# File 'lib/ripe/blocks/parallel_block.rb', line 23 def command @blocks.map { |block| "(\n%s\n) & " % block.command }.join('') + 'wait' end |