Class: Nmap::OSClass

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, vendor, family, accuracy) ⇒ OSClass

Creates a new OSClass object.

Parameters:

  • type (Symbol)

    The class of the OS.

  • vendor (String)

    The vendor of the OS.

  • family (String)

    The family of the OS.

  • accuracy (Integer)

    The accuracy of the OS guess.



31
32
33
34
35
36
# File 'lib/nmap/os_class.rb', line 31

def initialize(type,vendor,family,accuracy)
  @type = type
  @vendor = vendor
  @family = family
  @accuracy = accuracy
end

Instance Attribute Details

#accuracyObject (readonly)

The accuracy of the OS guess



14
15
16
# File 'lib/nmap/os_class.rb', line 14

def accuracy
  @accuracy
end

#familyObject (readonly)

The family of the OS



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

def family
  @family
end

#typeObject (readonly)

The OS class



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

def type
  @type
end

#vendorObject (readonly)

The OS vendor



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

def vendor
  @vendor
end

Instance Method Details

#to_sString

Converts the OS class to a String.

Returns:

  • (String)

    The String form of the OS class.



44
45
46
# File 'lib/nmap/os_class.rb', line 44

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