class Nmap::OSClass
Represents an {OS} class.
Public Class Methods
new(node)
click to toggle source
Initializes the os class.
@param [Nokogiri::XML::Node] node
The node that contains the OS Class information.
# File lib/nmap/os_class.rb, line 17 def initialize(node) @node = node end
Public Instance Methods
accuracy()
click to toggle source
The accuracy of the OS
class information.
@return [Integer]
Returns a number between 0 and 10
# File lib/nmap/os_class.rb, line 67 def accuracy @accuracy ||= @node.get_attribute('accuracy').to_i end
family()
click to toggle source
The OS
family.
@return [Symbol, nil]
# File lib/nmap/os_class.rb, line 46 def family @family ||= @node.get_attribute('osfamily').to_sym end
gen()
click to toggle source
The OS
generation.
@return [Symbol, nil]
# File lib/nmap/os_class.rb, line 55 def gen @gen ||= if @node['osgen'] @node['osgen'].to_sym end end
to_s()
click to toggle source
Converts the OS
class to a String.
@return [String]
The String form of the OS class.
# File lib/nmap/os_class.rb, line 77 def to_s "#{self.type} #{self.vendor} (#{self.accuracy}%)" end
type()
click to toggle source
The OS
type.
@return [String]
# File lib/nmap/os_class.rb, line 26 def type @type ||= if @node['type'] @node['type'].to_sym end end
vendor()
click to toggle source
The OS
vendor.
@return [String]
# File lib/nmap/os_class.rb, line 37 def vendor @vendor ||= @node.get_attribute('vendor') end