Class: Nexpose::ScanFilter

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

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

#failObject

Scan events to alert on.



8
9
10
# File 'lib/nexpose/alert.rb', line 8

def fail
  @fail
end

#pauseObject

Scan events to alert on.



8
9
10
# File 'lib/nexpose/alert.rb', line 8

def pause
  @pause
end

#resumeObject

Scan events to alert on.



8
9
10
# File 'lib/nexpose/alert.rb', line 8

def resume
  @resume
end

#startObject

Scan events to alert on.



8
9
10
# File 'lib/nexpose/alert.rb', line 8

def start
  @start
end

#stopObject

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