Class: CPEE::Transformation::Conditional

Inherits:
Object
  • Object
show all
Includes:
Container, Struct, Enumerable
Defined in:
lib/cpee/transformation/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, label = '') ⇒ Conditional

Returns a new instance of Conditional.



167
168
169
170
171
172
173
174
175
# File 'lib/cpee/transformation/structures.rb', line 167

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



165
166
167
# File 'lib/cpee/transformation/structures.rb', line 165

def attributes
  @attributes
end

#containerObject (readonly)

Returns the value of attribute container.



163
164
165
# File 'lib/cpee/transformation/structures.rb', line 163

def container
  @container
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#labelObject (readonly)

Returns the value of attribute label.



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

def label
  @label
end

#modeObject (readonly)

Returns the value of attribute mode.



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

def mode
  @mode
end

#subObject (readonly)

Returns the value of attribute sub.



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

def sub
  @sub
end

#typeObject

Returns the value of attribute type.



166
167
168
# File 'lib/cpee/transformation/structures.rb', line 166

def type
  @type
end

Instance Method Details

#new_branchObject



176
177
178
# File 'lib/cpee/transformation/structures.rb', line 176

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