Class: Nmap::Scan

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

Overview

Represents an Nmap scan.

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.



19
20
21
# File 'lib/nmap/scan.rb', line 19

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



5
6
7
# File 'lib/nmap/scan.rb', line 5

def protocol
  @protocol
end

#servicesObject

Returns the value of attribute services

Returns:

  • (Object)

    the current value of services



5
6
7
# File 'lib/nmap/scan.rb', line 5

def services
  @services
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



5
6
7
# File 'lib/nmap/scan.rb', line 5

def type
  @type
end

Instance Method Details

#to_sString

Converts the scan to a String.

Returns:

  • (String)

    The String form of the scan.



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

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