Class: Openvas::Report
- Inherits:
-
Object
- Object
- Openvas::Report
- Defined in:
- lib/openvas/reports.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Instance Method Summary collapse
-
#initialize(report) ⇒ Report
constructor
A new instance of Report.
- #results ⇒ Object
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
#comment ⇒ Object
Returns the value of attribute comment.
21 22 23 |
# File 'lib/openvas/reports.rb', line 21 def comment @comment end |
#created_at ⇒ Object
Returns the value of attribute created_at.
21 22 23 |
# File 'lib/openvas/reports.rb', line 21 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id.
21 22 23 |
# File 'lib/openvas/reports.rb', line 21 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
21 22 23 |
# File 'lib/openvas/reports.rb', line 21 def name @name end |
#updated_at ⇒ Object
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
#results ⇒ Object
33 34 35 |
# File 'lib/openvas/reports.rb', line 33 def results Openvas::Result.find_by_report_id(@id) end |