Class: Nexpose::ScanFilter
- Inherits:
-
Object
- Object
- Nexpose::ScanFilter
- Defined in:
- lib/nexpose/alert.rb
Overview
Scan filter for alerting. Set values to 1 to enable and 0 to disable.
Instance Attribute Summary collapse
-
#fail ⇒ Object
Scan events to alert on.
-
#pause ⇒ Object
Scan events to alert on.
-
#resume ⇒ Object
Scan events to alert on.
-
#start ⇒ Object
Scan events to alert on.
-
#stop ⇒ Object
Scan events to alert on.
Class Method Summary collapse
Instance Method Summary collapse
- #as_xml ⇒ Object
-
#initialize(start = 0, stop = 0, fail = 0, resume = 0, pause = 0) ⇒ ScanFilter
constructor
A new instance of ScanFilter.
- #to_xml ⇒ Object
Constructor Details
#initialize(start = 0, stop = 0, fail = 0, resume = 0, pause = 0) ⇒ ScanFilter
Returns a new instance of ScanFilter.
73 74 75 |
# File 'lib/nexpose/alert.rb', line 73 def initialize(start = 0, stop = 0, fail = 0, resume = 0, pause = 0) @start, @stop, @fail, @resume, @pause = start, stop, fail, resume, pause end |
Instance Attribute Details
#fail ⇒ Object
Scan events to alert on.
71 72 73 |
# File 'lib/nexpose/alert.rb', line 71 def fail @fail end |
#pause ⇒ Object
Scan events to alert on.
71 72 73 |
# File 'lib/nexpose/alert.rb', line 71 def pause @pause end |
#resume ⇒ Object
Scan events to alert on.
71 72 73 |
# File 'lib/nexpose/alert.rb', line 71 def resume @resume end |
#start ⇒ Object
Scan events to alert on.
71 72 73 |
# File 'lib/nexpose/alert.rb', line 71 def start @start end |
#stop ⇒ Object
Scan events to alert on.
71 72 73 |
# File 'lib/nexpose/alert.rb', line 71 def stop @stop end |
Class Method Details
.parse(xml) ⇒ Object
91 92 93 94 95 96 97 |
# File 'lib/nexpose/alert.rb', line 91 def self.parse(xml) new(xml.attributes['scanStart'].to_i, xml.attributes['scanStop'].to_i, xml.attributes['scanFailed'].to_i, xml.attributes['scanResumed'].to_i, xml.attributes['scanPaused'].to_i) end |
Instance Method Details
#as_xml ⇒ Object
77 78 79 80 81 82 83 84 85 |
# File 'lib/nexpose/alert.rb', line 77 def as_xml xml = REXML::Element.new('scanFilter') xml.attributes['scanStart'] = @start xml.attributes['scanStop'] = @stop xml.attributes['scanFailed'] = @fail xml.attributes['scanResumed'] = @resume xml.attributes['scanPaused'] = @pause xml end |
#to_xml ⇒ Object
87 88 89 |
# File 'lib/nexpose/alert.rb', line 87 def to_xml as_xml.to_s end |