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
-
#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.
70 71 72 |
# File 'lib/nexpose/alert.rb', line 70 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.
68 69 70 |
# File 'lib/nexpose/alert.rb', line 68 def fail @fail end |
#pause ⇒ Object
Scan events to alert on.
68 69 70 |
# File 'lib/nexpose/alert.rb', line 68 def pause @pause end |
#resume ⇒ Object
Scan events to alert on.
68 69 70 |
# File 'lib/nexpose/alert.rb', line 68 def resume @resume end |
#start ⇒ Object
Scan events to alert on.
68 69 70 |
# File 'lib/nexpose/alert.rb', line 68 def start @start end |
#stop ⇒ Object
Scan events to alert on.
68 69 70 |
# File 'lib/nexpose/alert.rb', line 68 def stop @stop end |
Class Method Details
.parse(xml) ⇒ Object
84 85 86 87 88 89 90 |
# File 'lib/nexpose/alert.rb', line 84 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
#to_xml ⇒ Object
74 75 76 77 78 79 80 81 82 |
# File 'lib/nexpose/alert.rb', line 74 def to_xml xml = '<scanFilter' xml << %( scanStart="#{@start}") xml << %( scanStop="#{@stop}") xml << %( scanFailed="#{@fail}") xml << %( scanResumed="#{@resume}") xml << %( scanPaused="#{@pause}") xml << '/>' end |