Class: CPEE::ProcessTransformation::Conditional

Inherits:
Object
  • Object
show all
Includes:
Container, Struct, Enumerable
Defined in:
lib/cpee/processtransformation/structures.rb

Overview

}}}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Struct

#each, #length

Methods included from Container

#container?

Constructor Details

#initialize(id, mode, type) ⇒ Conditional

Returns a new instance of Conditional.



156
157
158
159
160
161
162
163
# File 'lib/cpee/processtransformation/structures.rb', line 156

def initialize(id,mode,type)
  @container = true
  @id = id
  @sub = []
  @mode = mode
  @type = type
  @attributes = {}
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



154
155
156
# File 'lib/cpee/processtransformation/structures.rb', line 154

def attributes
  @attributes
end

#containerObject (readonly)

Returns the value of attribute container.



152
153
154
# File 'lib/cpee/processtransformation/structures.rb', line 152

def container
  @container
end

#idObject (readonly)

Returns the value of attribute id.



153
154
155
# File 'lib/cpee/processtransformation/structures.rb', line 153

def id
  @id
end

#modeObject (readonly)

Returns the value of attribute mode.



153
154
155
# File 'lib/cpee/processtransformation/structures.rb', line 153

def mode
  @mode
end

#subObject (readonly)

Returns the value of attribute sub.



153
154
155
# File 'lib/cpee/processtransformation/structures.rb', line 153

def sub
  @sub
end

#typeObject

Returns the value of attribute type.



155
156
157
# File 'lib/cpee/processtransformation/structures.rb', line 155

def type
  @type
end

Instance Method Details

#new_branchObject



164
165
166
# File 'lib/cpee/processtransformation/structures.rb', line 164

def new_branch
  (@sub << Alternative.new(@id)).last
end