Class: Nasl::List

Inherits:
Node
  • Object
show all
Defined in:
lib/nasl/parser/list.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) ⇒ List

Returns a new instance of List.



33
34
35
36
37
38
39
# File 'lib/nasl/parser/list.rb', line 33

def initialize(tree, *tokens)
  super

  @elems = if @tokens[1].is_a? ::Array then @tokens[1] else [] end

  @children << :elems
end

Instance Attribute Details

#elemsObject (readonly)

Returns the value of attribute elems.



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

def elems
  @elems
end