Class: MilkTea::AST::ForStmt
- Inherits:
-
Data
- Object
- Data
- MilkTea::AST::ForStmt
- Defined in:
- lib/milk_tea/core/ast.rb
Instance Attribute Summary collapse
-
#bindings ⇒ Object
readonly
Returns the value of attribute bindings.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#inline ⇒ Object
readonly
Returns the value of attribute inline.
-
#iterables ⇒ Object
readonly
Returns the value of attribute iterables.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#threaded ⇒ Object
readonly
Returns the value of attribute threaded.
Instance Method Summary collapse
- #binding ⇒ Object
-
#initialize(bindings:, iterables:, body:, inline: false, threaded: false, line: nil, column: nil) ⇒ ForStmt
constructor
A new instance of ForStmt.
- #iterable ⇒ Object
- #name ⇒ Object
- #names ⇒ Object
- #parallel? ⇒ Boolean
Constructor Details
#initialize(bindings:, iterables:, body:, inline: false, threaded: false, line: nil, column: nil) ⇒ ForStmt
Returns a new instance of ForStmt.
168 |
# File 'lib/milk_tea/core/ast.rb', line 168 def initialize(bindings:, iterables:, body:, inline: false, threaded: false, line: nil, column: nil) = super |
Instance Attribute Details
#bindings ⇒ Object (readonly)
Returns the value of attribute bindings
167 168 169 |
# File 'lib/milk_tea/core/ast.rb', line 167 def bindings @bindings end |
#body ⇒ Object (readonly)
Returns the value of attribute body
167 168 169 |
# File 'lib/milk_tea/core/ast.rb', line 167 def body @body end |
#column ⇒ Object (readonly)
Returns the value of attribute column
167 168 169 |
# File 'lib/milk_tea/core/ast.rb', line 167 def column @column end |
#inline ⇒ Object (readonly)
Returns the value of attribute inline
167 168 169 |
# File 'lib/milk_tea/core/ast.rb', line 167 def inline @inline end |
#iterables ⇒ Object (readonly)
Returns the value of attribute iterables
167 168 169 |
# File 'lib/milk_tea/core/ast.rb', line 167 def iterables @iterables end |
#line ⇒ Object (readonly)
Returns the value of attribute line
167 168 169 |
# File 'lib/milk_tea/core/ast.rb', line 167 def line @line end |
#threaded ⇒ Object (readonly)
Returns the value of attribute threaded
167 168 169 |
# File 'lib/milk_tea/core/ast.rb', line 167 def threaded @threaded end |
Instance Method Details
#binding ⇒ Object
171 |
# File 'lib/milk_tea/core/ast.rb', line 171 def binding = bindings.first |
#iterable ⇒ Object
172 |
# File 'lib/milk_tea/core/ast.rb', line 172 def iterable = iterables.first |
#name ⇒ Object
169 |
# File 'lib/milk_tea/core/ast.rb', line 169 def name = bindings.first.name |
#names ⇒ Object
170 |
# File 'lib/milk_tea/core/ast.rb', line 170 def names = bindings.map(&:name) |
#parallel? ⇒ Boolean
173 |
# File 'lib/milk_tea/core/ast.rb', line 173 def parallel? = bindings.length > 1 || iterables.length > 1 |