Class: Nmap::OSClass
Overview
Represents an OS class.
Instance Method Summary collapse
-
#accuracy ⇒ Integer
The accuracy of the OS class information.
-
#family ⇒ Symbol?
The OS family.
-
#gen ⇒ Symbol?
The OS generation.
-
#initialize(node) ⇒ OSClass
constructor
Initializes the os class.
-
#to_s ⇒ String
Converts the OS class to a String.
-
#type ⇒ String
The OS type.
-
#vendor ⇒ String
The OS vendor.
Methods included from CPE
Constructor Details
#initialize(node) ⇒ OSClass
Initializes the os class.
17 18 19 |
# File 'lib/nmap/os_class.rb', line 17 def initialize(node) @node = node end |
Instance Method Details
#accuracy ⇒ Integer
The accuracy of the OS class information.
67 68 69 |
# File 'lib/nmap/os_class.rb', line 67 def accuracy @accuracy ||= @node.get_attribute('accuracy').to_i end |
#family ⇒ Symbol?
The OS family.
46 47 48 |
# File 'lib/nmap/os_class.rb', line 46 def family @family ||= @node.get_attribute('osfamily').to_sym end |
#gen ⇒ Symbol?
The OS generation.
55 56 57 58 59 |
# File 'lib/nmap/os_class.rb', line 55 def gen @gen ||= if @node['osgen'] @node['osgen'].to_sym end end |
#to_s ⇒ String
Converts the OS class to a String.
77 78 79 |
# File 'lib/nmap/os_class.rb', line 77 def to_s "#{self.type} #{self.vendor} (#{self.accuracy}%)" end |
#type ⇒ String
The OS type.
26 27 28 29 30 |
# File 'lib/nmap/os_class.rb', line 26 def type @type ||= if @node['type'] @node['type'].to_sym end end |
#vendor ⇒ String
The OS vendor.
37 38 39 |
# File 'lib/nmap/os_class.rb', line 37 def vendor @vendor ||= @node.get_attribute('vendor') end |