Class: Nasl::Ip
Instance Attribute Summary collapse
-
#octets ⇒ Object
readonly
Returns the value of attribute octets.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(tree, *tokens) ⇒ Ip
constructor
A new instance of Ip.
- #to_xml(xml) ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(tree, *tokens) ⇒ Ip
Returns a new instance of Ip.
33 34 35 36 37 |
# File 'lib/nasl/parser/ip.rb', line 33 def initialize(tree, *tokens) super @octets = [@tokens[0], @tokens[2], @tokens[4], @tokens[6]] end |
Instance Attribute Details
#octets ⇒ Object (readonly)
Returns the value of attribute octets.
31 32 33 |
# File 'lib/nasl/parser/ip.rb', line 31 def octets @octets end |
Instance Method Details
#to_xml(xml) ⇒ Object
39 40 41 |
# File 'lib/nasl/parser/ip.rb', line 39 def to_xml(xml) xml.ip(:octets=>@octets.join('.')) end |