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.



579
580
581
# File 'lib/nexpose/scan.rb', line 579

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

Instance Attribute Details

#deadObject (readonly)

Returns the value of attribute dead.



577
578
579
# File 'lib/nexpose/scan.rb', line 577

def dead
  @dead
end

#filteredObject (readonly)

Returns the value of attribute filtered.



577
578
579
# File 'lib/nexpose/scan.rb', line 577

def filtered
  @filtered
end

#liveObject (readonly)

Returns the value of attribute live.



577
578
579
# File 'lib/nexpose/scan.rb', line 577

def live
  @live
end

#otherObject (readonly)

Returns the value of attribute other.



577
578
579
# File 'lib/nexpose/scan.rb', line 577

def other
  @other
end

#unresolvedObject (readonly)

Returns the value of attribute unresolved.



577
578
579
# File 'lib/nexpose/scan.rb', line 577

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.



588
589
590
591
592
593
594
595
# File 'lib/nexpose/scan.rb', line 588

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