Class: Nasl::Identifier

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

Instance Attribute Summary collapse

Attributes inherited from Node

#ctx, #tokens

Instance Method Summary collapse

Methods inherited from Node

#context, #region

Constructor Details

#initialize(tree, *tokens) ⇒ Identifier

Returns a new instance of Identifier.



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

def initialize(tree, *tokens)
  super

  @name = @tokens.first.body
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

#to_xml(xml) ⇒ Object



39
40
41
# File 'lib/nasl/parser/identifier.rb', line 39

def to_xml(xml)
  xml.identifier(:name=>@name)
end