Class: Nmap::Sequence

Inherits:
Object
  • Object
show all
Defined in:
lib/nmap/sequence.rb

Overview

Base class for all Sequence classes.

Since:

  • 0.5.0

Direct Known Subclasses

IpIdSequence, TcpSequence, TcpTsSequence

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ Sequence

Creates a new sequence object.

Parameters:

  • node (Nokogiri::XML::Node)

    The node that contains the sequence information.

Since:

  • 0.5.0



17
18
19
# File 'lib/nmap/sequence.rb', line 17

def initialize(node)
  @node = node
end

Instance Method Details

#descriptionString

The description of the sequence.

Returns:

  • (String)

    The sequence class from nmap.

Since:

  • 0.5.0



29
30
31
# File 'lib/nmap/sequence.rb', line 29

def description
  @description ||= @node['class']
end

#valuesArray<Numeric>

The values within the sequence.

Returns:

  • (Array<Numeric>)

    A sample of sequence numbers taken by nmap.

Since:

  • 0.5.0



41
42
43
44
45
46
47
# File 'lib/nmap/sequence.rb', line 41

def values
  @values ||= if @node['values']
                @node['values'].split(',').map { |value| value.to_i(16) }
              else
                []
              end
end