Class: Nmap::XML::Scan

Inherits:
Struct
  • Object
show all
Defined in:
lib/nmap/xml/scan.rb

Overview

Represents an Nmap scan.

Since:

  • 1.0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, protocol, services = []) ⇒ Scan

Creates a new Scan object.

Parameters:

  • type (Symbol)

    The type of the scan.

  • protocol (Symbol)

    The protocol used for the scan.

  • services (Array<Integer, Rage>) (defaults to: [])

    The port numbers scanned.

Since:

  • 1.0.0



24
25
26
# File 'lib/nmap/xml/scan.rb', line 24

def initialize(type,protocol,services=[])
  super(type,protocol,services)
end

Instance Attribute Details

#protocolObject

Returns the value of attribute protocol

Returns:

  • (Object)

    the current value of protocol



10
11
12
# File 'lib/nmap/xml/scan.rb', line 10

def protocol
  @protocol
end

#servicesObject

Returns the value of attribute services

Returns:

  • (Object)

    the current value of services



10
11
12
# File 'lib/nmap/xml/scan.rb', line 10

def services
  @services
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



10
11
12
# File 'lib/nmap/xml/scan.rb', line 10

def type
  @type
end

Instance Method Details

#to_sString

Converts the scan to a String.

Returns:

  • (String)

    The String form of the scan.

Since:

  • 1.0.0



34
35
36
# File 'lib/nmap/xml/scan.rb', line 34

def to_s
  "#{self.protocol} #{self.type}"
end