Class: Ripe::Blocks::ParallelBlock

Inherits:
MultiBlock show all
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

#blocks, #id, #vars

Instance Method Summary collapse

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.

Parameters:

  • blocks (Array<Block>)

    list of children blocks



16
17
18
# File 'lib/ripe/blocks/parallel_block.rb', line 16

def initialize(*blocks)
  super(:|, *blocks)
end

Instance Method Details

#commandString

Return the string command of the subtree starting at the current block.

Returns:

  • (String)

    subtree command



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