Class: TRuby::IR::ForLoop
Overview
For loop / each iteration
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#iterable ⇒ Object
Returns the value of attribute iterable.
-
#variable ⇒ Object
Returns the value of attribute variable.
Attributes inherited from Node
#location, #metadata, #type_info
Instance Method Summary collapse
- #children ⇒ Object
-
#initialize(variable:, iterable:, body:, **opts) ⇒ ForLoop
constructor
A new instance of ForLoop.
Methods inherited from Node
Constructor Details
#initialize(variable:, iterable:, body:, **opts) ⇒ ForLoop
Returns a new instance of ForLoop.
333 334 335 336 337 338 |
# File 'lib/t_ruby/ir.rb', line 333 def initialize(variable:, iterable:, body:, **opts) super(**opts) @variable = variable @iterable = iterable @body = body end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
331 332 333 |
# File 'lib/t_ruby/ir.rb', line 331 def body @body end |
#iterable ⇒ Object
Returns the value of attribute iterable.
331 332 333 |
# File 'lib/t_ruby/ir.rb', line 331 def iterable @iterable end |
#variable ⇒ Object
Returns the value of attribute variable.
331 332 333 |
# File 'lib/t_ruby/ir.rb', line 331 def variable @variable end |
Instance Method Details
#children ⇒ Object
340 341 342 |
# File 'lib/t_ruby/ir.rb', line 340 def children [@iterable, @body] end |