Sha256: 371c9a87cbe718c06e5129e40c4b07f8b2f6c14691c7752cad74d512ff04f039
Contents?: true
Size: 1.11 KB
Versions: 1
Compression:
Stored size: 1.11 KB
Contents
module Nmap # # Base class for all Sequence classes. # # @since 0.5.0 # class Sequence # # Creates a new sequence object. # # @param [Nokogiri::XML::Node] node # The node that contains the sequence information. # # @yield [sequence] # If a block is given, it will passed the newly created sequence. # # @yieldparam [Sequence] sequence # The newly created sequence object. # # @since 0.5.0 # def initialize(node) @node = node yield self if block_given? end # # The description of the sequence. # # @return [String] # The sequence class from nmap. # # @since 0.5.0 # def description @node['class'] end # # The values within the sequence. # # @return [Array<Numeric>] # A sample of sequence numbers taken by nmap. # # @since 0.5.0 # def values unless @values @values = [] if (string = @node['values']) string.scan(/[^\s,]+/) { |match| @values << match.to_i(16) } end end return @values end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ruby-nmap-0.6.0 | lib/nmap/sequence.rb |