Class: Openvas::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/openvas/reports.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(report) ⇒ Report



23
24
25
26
27
28
29
30
31
# File 'lib/openvas/reports.rb', line 23

def initialize(report)
  @id = report.at_xpath('@id').value
  @name = report.at_xpath('name').text
  @comment = report.at_xpath('comment').text
  @user = report.at_xpath('owner/name').text

  @created_at = Time.parse(report.at_xpath('creation_time').text)
  @updated_at = Time.parse(report.at_xpath('modification_time').text)
end

Instance Attribute Details

#commentObject

Returns the value of attribute comment.



21
22
23
# File 'lib/openvas/reports.rb', line 21

def comment
  @comment
end

#created_atObject

Returns the value of attribute created_at.



21
22
23
# File 'lib/openvas/reports.rb', line 21

def created_at
  @created_at
end

#idObject

Returns the value of attribute id.



21
22
23
# File 'lib/openvas/reports.rb', line 21

def id
  @id
end

#nameObject

Returns the value of attribute name.



21
22
23
# File 'lib/openvas/reports.rb', line 21

def name
  @name
end

#updated_atObject

Returns the value of attribute updated_at.



21
22
23
# File 'lib/openvas/reports.rb', line 21

def updated_at
  @updated_at
end

Instance Method Details

#resultsObject



33
34
35
# File 'lib/openvas/reports.rb', line 33

def results
  Openvas::Result.find_by_report_id(@id)
end