Class: Nmap::Sequence
- Inherits:
-
Object
- Object
- Nmap::Sequence
- Defined in:
- lib/nmap/sequence.rb
Overview
Base class for all Sequence classes.
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.
23 24 25 26 27 |
# File 'lib/nmap/sequence.rb', line 23 def initialize(node) @node = node yield self if block_given? end |
Instance Method Details
#description ⇒ String
The description of the sequence.
37 38 39 |
# File 'lib/nmap/sequence.rb', line 37 def description @node['class'] end |
#values ⇒ Array<Numeric>
The values within the sequence.
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/nmap/sequence.rb', line 49 def values unless @values @values = [] if (string = @node['values']) string.scan(/[^\s,]+/) { |match| @values << match.to_i(16) } end end return @values end |