Class: Nexpose::ScanSummary::Nodes

Inherits:
Object
  • Object
show all
Defined in:
lib/nexpose/scan.rb

Overview

Value class for tracking node counts.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(live, dead, filtered, unresolved, other) ⇒ Nodes

Returns a new instance of Nodes.



634
635
636
637
638
639
640
# File 'lib/nexpose/scan.rb', line 634

def initialize(live, dead, filtered, unresolved, other)
  @live       = live
  @dead       = dead
  @filtered   = filtered
  @unresolved = unresolved
  @other      = other
end

Instance Attribute Details

#deadObject (readonly)

Returns the value of attribute dead.



632
633
634
# File 'lib/nexpose/scan.rb', line 632

def dead
  @dead
end

#filteredObject (readonly)

Returns the value of attribute filtered.



632
633
634
# File 'lib/nexpose/scan.rb', line 632

def filtered
  @filtered
end

#liveObject (readonly)

Returns the value of attribute live.



632
633
634
# File 'lib/nexpose/scan.rb', line 632

def live
  @live
end

#otherObject (readonly)

Returns the value of attribute other.



632
633
634
# File 'lib/nexpose/scan.rb', line 632

def other
  @other
end

#unresolvedObject (readonly)

Returns the value of attribute unresolved.



632
633
634
# File 'lib/nexpose/scan.rb', line 632

def unresolved
  @unresolved
end

Class Method Details

.parse(rexml) ⇒ Nodes

Parse REXML to Nodes object.

Parameters:

  • rexml (REXML::Document)

    XML document to parse.

Returns:

  • (Nodes)

    Node summary represented by the XML.



647
648
649
650
651
652
653
654
# File 'lib/nexpose/scan.rb', line 647

def self.parse(rexml)
  return nil unless rexml
  Nodes.new(rexml.attributes['live'].to_i,
            rexml.attributes['dead'].to_i,
            rexml.attributes['filtered'].to_i,
            rexml.attributes['unresolved'].to_i,
            rexml.attributes['other'].to_i)
end