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

#[]=, #next=

Constructor Details

#initialize(name) ⇒ Parallel

Returns a new instance of Parallel.



102
103
104
105
106
# File 'lib/simplerubysteps/model.rb', line 102

def initialize(name)
  super
  @dict[:Type] = "Parallel"
  @branches = []
end

Instance Attribute Details

#branchesObject (readonly)

Returns the value of attribute branches.



100
101
102
# File 'lib/simplerubysteps/model.rb', line 100

def branches
  @branches
end

Instance Method Details

#new_branchObject



108
109
110
111
112
# File 'lib/simplerubysteps/model.rb', line 108

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

#renderObject



114
115
116
117
118
# File 'lib/simplerubysteps/model.rb', line 114

def render
  dict = super
  dict[:Branches] = @branches.map { |b| b.render }
  dict
end