Class: Nexpose::Scan

Inherits:
Object
  • Object
show all
Defined in:
lib/nexpose/scan.rb

Overview

Struct class for tracking scan launch information.

Defined Under Namespace

Modules: Status

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scan_id, engine_id) ⇒ Scan

Returns a new instance of Scan.



680
681
682
# File 'lib/nexpose/scan.rb', line 680

def initialize(scan_id, engine_id)
  @id, @engine = scan_id, engine_id
end

Instance Attribute Details

#engineObject (readonly)

The engine the scan was dispatched to.



678
679
680
# File 'lib/nexpose/scan.rb', line 678

def engine
  @engine
end

#idObject (readonly)

The scan ID when a scan is successfully launched.



676
677
678
# File 'lib/nexpose/scan.rb', line 676

def id
  @id
end

Class Method Details

.parse(xml) ⇒ Object



684
685
686
687
688
689
# File 'lib/nexpose/scan.rb', line 684

def self.parse(xml)
  xml.elements.each('//Scan') do |scan|
    return new(scan.attributes['scan-id'].to_i,
               scan.attributes['engine-id'].to_i)
  end
end