Class: Nexpose::ScanSummary::Tasks

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

Overview

Value class to tracking task counts.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pending, active, completed) ⇒ Tasks

Returns a new instance of Tasks.



557
558
559
# File 'lib/nexpose/scan.rb', line 557

def initialize(pending, active, completed)
  @pending, @active, @completed = pending, active, completed
end

Instance Attribute Details

#activeObject (readonly)

Returns the value of attribute active.



555
556
557
# File 'lib/nexpose/scan.rb', line 555

def active
  @active
end

#completedObject (readonly)

Returns the value of attribute completed.



555
556
557
# File 'lib/nexpose/scan.rb', line 555

def completed
  @completed
end

#pendingObject (readonly)

Returns the value of attribute pending.



555
556
557
# File 'lib/nexpose/scan.rb', line 555

def pending
  @pending
end

Class Method Details

.parse(rexml) ⇒ Tasks

Parse REXML to Tasks object.

Parameters:

  • rexml (REXML::Document)

    XML document to parse.

Returns:

  • (Tasks)

    Task summary represented by the XML.



566
567
568
569
570
571
# File 'lib/nexpose/scan.rb', line 566

def self.parse(rexml)
  return nil unless rexml
  Tasks.new(rexml.attributes['pending'].to_i,
            rexml.attributes['active'].to_i,
            rexml.attributes['completed'].to_i)
end