Class: Hokusai::Ast::Loop
- Inherits:
-
Object
- Object
- Hokusai::Ast::Loop
- Defined in:
- ui/src/hokusai/ast.rb
Overview
A node representing a loop
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
-
#initialize(raw) ⇒ Loop
constructor
A new instance of Loop.
-
#method ⇒ Object
The loop method eg [for=“item in list”] the method is ‘list`.
-
#var ⇒ Object
The loop variable eg [for=“item in list”] the var is ‘item`.
Constructor Details
#initialize(raw) ⇒ Loop
Returns a new instance of Loop.
23 24 25 |
# File 'ui/src/hokusai/ast.rb', line 23 def initialize(raw) @raw = raw end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
21 22 23 |
# File 'ui/src/hokusai/ast.rb', line 21 def raw @raw end |
Instance Method Details
#method ⇒ Object
The loop method eg [for=“item in list”] the method is ‘list`
37 38 39 |
# File 'ui/src/hokusai/ast.rb', line 37 def method @list_name ||= raw[:list_name].freeze end |
#var ⇒ Object
The loop variable eg [for=“item in list”] the var is ‘item`
30 31 32 |
# File 'ui/src/hokusai/ast.rb', line 30 def var @name ||= raw[:name].freeze end |