Class: Nasl::String
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(tree, *tokens) ⇒ String
constructor
A new instance of String.
- #to_xml(xml) ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(tree, *tokens) ⇒ String
Returns a new instance of String.
33 34 35 36 37 38 |
# File 'lib/nasl/parser/string.rb', line 33 def initialize(tree, *tokens) super @text = @tokens.first.body @type = @tokens.first.type end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
31 32 33 |
# File 'lib/nasl/parser/string.rb', line 31 def text @text end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
31 32 33 |
# File 'lib/nasl/parser/string.rb', line 31 def type @type end |
Instance Method Details
#to_xml(xml) ⇒ Object
40 41 42 |
# File 'lib/nasl/parser/string.rb', line 40 def to_xml(xml) xml.method_missing(@type.downcase, @text) end |