Class: Simplerubysteps::Parallel
- Defined in:
- lib/simplerubysteps/model.rb
Instance Attribute Summary collapse
-
#branches ⇒ Object
readonly
Returns the value of attribute branches.
Attributes inherited from State
Instance Method Summary collapse
-
#initialize(name) ⇒ Parallel
constructor
A new instance of Parallel.
- #new_branch ⇒ Object
- #render ⇒ Object
Methods inherited from State
#[]=, #error_catch, #error_retry, #next=, #task_timeout
Constructor Details
#initialize(name) ⇒ Parallel
Returns a new instance of Parallel.
139 140 141 142 143 |
# File 'lib/simplerubysteps/model.rb', line 139 def initialize(name) super @dict[:Type] = "Parallel" @branches = [] end |
Instance Attribute Details
#branches ⇒ Object (readonly)
Returns the value of attribute branches.
137 138 139 |
# File 'lib/simplerubysteps/model.rb', line 137 def branches @branches end |
Instance Method Details
#new_branch ⇒ Object
145 146 147 148 149 |
# File 'lib/simplerubysteps/model.rb', line 145 def new_branch b = Branch.new @branches.push b b end |
#render ⇒ Object
151 152 153 154 155 |
# File 'lib/simplerubysteps/model.rb', line 151 def render dict = super dict[:Branches] = @branches.map { |b| b.render } dict end |