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.



610
611
612
613
614
# File 'lib/nexpose/scan.rb', line 610

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

Instance Attribute Details

#activeObject (readonly)

Returns the value of attribute active.



608
609
610
# File 'lib/nexpose/scan.rb', line 608

def active
  @active
end

#completedObject (readonly)

Returns the value of attribute completed.



608
609
610
# File 'lib/nexpose/scan.rb', line 608

def completed
  @completed
end

#pendingObject (readonly)

Returns the value of attribute pending.



608
609
610
# File 'lib/nexpose/scan.rb', line 608

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.



621
622
623
624
625
626
# File 'lib/nexpose/scan.rb', line 621

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