Class: Hokusai::Ast::Loop

Inherits:
Object
  • Object
show all
Defined in:
ui/src/hokusai/ast.rb

Overview

A node representing a loop

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#rawObject (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

#methodObject

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

#varObject

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