Class: Nmap::OSMatch

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, accuracy) ⇒ OSMatch

Creates a OSMatch object.

Parameters:

  • name (String)

    The name of the OS.

  • accuracy (Integer)

    The accuracy of the OS guess.



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

def initialize(name,accuracy)
  @name = name
  @accuracy = accuracy
end

Instance Attribute Details

#accuracyObject (readonly)

The accuracy of the OS guess



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

def accuracy
  @accuracy
end

#nameObject (readonly)

The name of the OS



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

def name
  @name
end

Instance Method Details

#to_sString

Converts the OS match to a String.

Returns:

  • (String)

    The String form of the OS match.



30
31
32
# File 'lib/nmap/os_match.rb', line 30

def to_s
  "#{@name} (#{@accuracy}%)"
end