Class: OpenvasCli::VasTaskProgress

Inherits:
Object
  • Object
show all
Includes:
XmlAddin
Defined in:
lib/openvas-cli/vas_task_progress.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from XmlAddin

included

Class Method Details

.from_xml_node(node) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/openvas-cli/vas_task_progress.rb', line 20

def self.from_xml_node(node)
  ret = VasTaskProgress.new
  ret.overall = extract_value_from(".", node).to_i
  node.xpath("./host_progress").each { |p_node|
    prg = extract_value_from(".", p_node).to_i
    hst = extract_value_from("host", p_node)
    ret.ip_stats[hst] = prg
  }
  ret
end

Instance Method Details

#ip_statsObject



16
17
18
# File 'lib/openvas-cli/vas_task_progress.rb', line 16

def ip_stats
  @ip_stats ||= {}
end

#overallObject



8
9
10
# File 'lib/openvas-cli/vas_task_progress.rb', line 8

def overall
  @overall ||= 0
end

#overall=(val) ⇒ Object



12
13
14
# File 'lib/openvas-cli/vas_task_progress.rb', line 12

def overall=(val)
  @overall = val
end