Class: Nmap::Sequence
- Inherits:
-
Object
- Object
- Nmap::Sequence
- Defined in:
- lib/nmap/sequence.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#description ⇒ String
The description of the sequence.
-
#initialize(node) {|sequence| ... } ⇒ Sequence
constructor
Creates a new sequence object.
-
#values ⇒ Array<Numeric>
The values within the sequence.
Constructor Details
#initialize(node) {|sequence| ... } ⇒ Sequence
Creates a new sequence object.
18 19 20 21 22 |
# File 'lib/nmap/sequence.rb', line 18 def initialize(node) @node = node yield self if block_given? end |
Instance Method Details
#description ⇒ String
The description of the sequence.
32 33 34 |
# File 'lib/nmap/sequence.rb', line 32 def description @node['class'] end |
#values ⇒ Array<Numeric>
The values within the sequence.
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/nmap/sequence.rb', line 44 def values unless @values @values = [] if (string = @node['values']) string.scan(/[^\s,]+/) { |match| @values << match.to_i(16) } end end return @values end |