Class: Nexpose::ScanFilter
- Inherits:
-
Object
- Object
- Nexpose::ScanFilter
- Includes:
- JsonSerializer
- 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.
Methods included from JsonSerializer
#deserialize, #serialize, #to_hash
Constructor Details
#initialize(start = 0, stop = 0, fail = 0, resume = 0, pause = 0) ⇒ ScanFilter
Returns a new instance of ScanFilter.
10 11 12 |
# File 'lib/nexpose/alert.rb', line 10 def initialize(start = 0, stop = 0, fail = 0, resume = 0, pause = 0) @start, @stop, @fail, @resume, @pause = start.to_i, stop.to_i, fail.to_i, resume.to_i, pause.to_i end |
Instance Attribute Details
#fail ⇒ Object
Scan events to alert on.
8 9 10 |
# File 'lib/nexpose/alert.rb', line 8 def fail @fail end |
#pause ⇒ Object
Scan events to alert on.
8 9 10 |
# File 'lib/nexpose/alert.rb', line 8 def pause @pause end |
#resume ⇒ Object
Scan events to alert on.
8 9 10 |
# File 'lib/nexpose/alert.rb', line 8 def resume @resume end |
#start ⇒ Object
Scan events to alert on.
8 9 10 |
# File 'lib/nexpose/alert.rb', line 8 def start @start end |
#stop ⇒ Object
Scan events to alert on.
8 9 10 |
# File 'lib/nexpose/alert.rb', line 8 def stop @stop end |
Class Method Details
.json_initializer(filter) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/nexpose/alert.rb', line 14 def self.json_initializer(filter) new(filter[:start] ? 1 : 0, filter[:stop] ? 1 : 0, filter[:failed] ? 1 : 0, filter[:resume] ? 1 : 0, filter[:pause] ? 1 : 0) end |