Class: Nasl::Foreach

Inherits:
Node
  • Object
show all
Defined in:
lib/nasl/parser/foreach.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#ctx, #tokens

Instance Method Summary collapse

Methods inherited from Node

#context, #region, #to_xml

Constructor Details

#initialize(tree, *tokens) ⇒ Foreach

Returns a new instance of Foreach.



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/nasl/parser/foreach.rb', line 33

def initialize(tree, *tokens)
  super

  @iter = @tokens[1]
  @expr = @tokens[2]
  @body = @tokens[3]

  @children << :iter
  @children << :expr
  @children << :body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



31
32
33
# File 'lib/nasl/parser/foreach.rb', line 31

def body
  @body
end

#exprObject (readonly)

Returns the value of attribute expr.



31
32
33
# File 'lib/nasl/parser/foreach.rb', line 31

def expr
  @expr
end

#iterObject (readonly)

Returns the value of attribute iter.



31
32
33
# File 'lib/nasl/parser/foreach.rb', line 31

def iter
  @iter
end