Class: Nexpose::ScanSummary::Vulnerabilities::Status
- Inherits:
-
Object
- Object
- Nexpose::ScanSummary::Vulnerabilities::Status
- Defined in:
- lib/nexpose/scan.rb
Overview
Value class for tracking vulnerability status counts.
Severities will only be mapped if they are provided in the response, which currently only happens for vuln-exploit, vuln-version, and vuln-potential.
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#severities ⇒ Object
readonly
Returns the value of attribute severities.
Instance Method Summary collapse
-
#add_severity(severity, count) ⇒ Object
For vuln-exploit, vuln-version, and vuln-potential, map the count at a severity level, but also maintain an overall count.
-
#initialize(severity = nil, count = 0) ⇒ Status
constructor
A new instance of Status.
Constructor Details
#initialize(severity = nil, count = 0) ⇒ Status
Returns a new instance of Status.
652 653 654 655 656 657 658 659 660 661 |
# File 'lib/nexpose/scan.rb', line 652 def initialize(severity = nil, count = 0) if severity @severities = {} @count = 0 add_severity(severity.to_i, count) else @severities = nil @count = count end end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
650 651 652 |
# File 'lib/nexpose/scan.rb', line 650 def count @count end |
#severities ⇒ Object (readonly)
Returns the value of attribute severities.
650 651 652 |
# File 'lib/nexpose/scan.rb', line 650 def severities @severities end |
Instance Method Details
#add_severity(severity, count) ⇒ Object
For vuln-exploit, vuln-version, and vuln-potential, map the count at a severity level, but also maintain an overall count.
665 666 667 668 |
# File 'lib/nexpose/scan.rb', line 665 def add_severity(severity, count) @count += count @severities[severity] = count end |