Class: CPEE::Transformation::Loop
- Inherits:
-
Object
- Object
- CPEE::Transformation::Loop
- Defined in:
- lib/cpee/transformation/structures.rb
Overview
}}}
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#condition ⇒ Object
Returns the value of attribute condition.
-
#condition_type ⇒ Object
Returns the value of attribute condition_type.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#sub ⇒ Object
readonly
Returns the value of attribute sub.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #condition? ⇒ Boolean
-
#initialize(id) ⇒ Loop
constructor
A new instance of Loop.
- #new_branch ⇒ Object
Methods included from Struct
Methods included from Container
Constructor Details
#initialize(id) ⇒ Loop
Returns a new instance of Loop.
125 126 127 128 129 130 131 132 133 134 |
# File 'lib/cpee/transformation/structures.rb', line 125 def initialize(id) @container = true @id = id @type = :loop @mode = :pre_test @condition = [] @sub = [] @condition_type = nil @attributes = {} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
123 124 125 |
# File 'lib/cpee/transformation/structures.rb', line 123 def attributes @attributes end |
#condition ⇒ Object
Returns the value of attribute condition.
122 123 124 |
# File 'lib/cpee/transformation/structures.rb', line 122 def condition @condition end |
#condition_type ⇒ Object
Returns the value of attribute condition_type.
122 123 124 |
# File 'lib/cpee/transformation/structures.rb', line 122 def condition_type @condition_type end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
121 122 123 |
# File 'lib/cpee/transformation/structures.rb', line 121 def id @id end |
#mode ⇒ Object
Returns the value of attribute mode.
122 123 124 |
# File 'lib/cpee/transformation/structures.rb', line 122 def mode @mode end |
#sub ⇒ Object (readonly)
Returns the value of attribute sub.
121 122 123 |
# File 'lib/cpee/transformation/structures.rb', line 121 def sub @sub end |
#type ⇒ Object
Returns the value of attribute type.
122 123 124 |
# File 'lib/cpee/transformation/structures.rb', line 122 def type @type end |
Instance Method Details
#condition? ⇒ Boolean
124 |
# File 'lib/cpee/transformation/structures.rb', line 124 def condition?; true; end |
#new_branch ⇒ Object
135 136 137 |
# File 'lib/cpee/transformation/structures.rb', line 135 def new_branch (@sub << Alternative.new(@id)).last end |