Class: Simplerubysteps::Parallel

Inherits:
State
  • Object
show all
Defined in:
lib/simplerubysteps/model.rb

Instance Attribute Summary collapse

Attributes inherited from State

#name, #state_machine

Instance Method Summary collapse

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

#branchesObject (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_branchObject



145
146
147
148
149
# File 'lib/simplerubysteps/model.rb', line 145

def new_branch
  b = Branch.new
  @branches.push b
  b
end

#renderObject



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