class Nmap::XML::OSClass
Represents an {OS} class.
@since 1.0.0
Public Class Methods
new(node)
click to toggle source
Initializes the OS
.
@param [Nokogiri::XML::Node] node
The node that contains the OS Class information.
# File lib/nmap/xml/os_class.rb, line 20 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/xml/os_class.rb, line 70 def accuracy @accuracy ||= @node.get_attribute('accuracy').to_i end
family()
click to toggle source
The OS
family.
@return [Symbol, nil]
# File lib/nmap/xml/os_class.rb, line 49 def family @family ||= @node.get_attribute('osfamily').to_sym end
gen()
click to toggle source
The OS
generation.
@return [Symbol, nil]
# File lib/nmap/xml/os_class.rb, line 58 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/xml/os_class.rb, line 80 def to_s "#{self.type} #{self.vendor} (#{self.accuracy}%)" end
type()
click to toggle source
The OS
type.
@return [String]
# File lib/nmap/xml/os_class.rb, line 29 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/xml/os_class.rb, line 40 def vendor @vendor ||= @node.get_attribute('vendor') end