Class: Nasl::KeyValuePair

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

Returns a new instance of KeyValuePair.



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

def initialize(tree, *tokens)
  super

  @key = tokens[0]
  @value = tokens[2]

  @children << :key
  @children << :value
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



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

def key
  @key
end

#valueObject (readonly)

Returns the value of attribute value.



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

def value
  @value
end