Class: Nmap::Scan

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

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.



25
26
27
28
29
# File 'lib/nmap/scan.rb', line 25

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

Instance Attribute Details

#protocolObject (readonly)

The protocol used for the scan



8
9
10
# File 'lib/nmap/scan.rb', line 8

def protocol
  @protocol
end

#servicesObject (readonly)

The port numbers that were scanned



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

def services
  @services
end

#typeObject (readonly)

The type of scan



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.



37
38
39
# File 'lib/nmap/scan.rb', line 37

def to_s
  "#{@protocol} #{@type}"
end