Class: Nexpose::ReportTemplateSummary
- Inherits:
-
Object
- Object
- Nexpose::ReportTemplateSummary
- Defined in:
- lib/nexpose/report_template.rb
Overview
Data object for report template summary information. Not meant for use in creating new templates.
Instance Attribute Summary collapse
-
#built_in ⇒ Object
readonly
Whether the report template is built-in, and therefore cannot be modified.
-
#description ⇒ Object
readonly
Description of the report template.
-
#id ⇒ Object
readonly
The ID of the report template.
-
#name ⇒ Object
readonly
The name of the report template.
-
#scope ⇒ Object
readonly
The visibility (scope) of the report template.
-
#type ⇒ Object
readonly
One of: data|document.
Class Method Summary collapse
Instance Method Summary collapse
- #delete(connection) ⇒ Object
-
#initialize(id, name, type, scope, built_in, description) ⇒ ReportTemplateSummary
constructor
A new instance of ReportTemplateSummary.
Constructor Details
#initialize(id, name, type, scope, built_in, description) ⇒ ReportTemplateSummary
Returns a new instance of ReportTemplateSummary.
55 56 57 58 59 60 61 62 |
# File 'lib/nexpose/report_template.rb', line 55 def initialize(id, name, type, scope, built_in, description) @id = id @name = name @type = type @scope = scope @built_in = built_in @description = description end |
Instance Attribute Details
#built_in ⇒ Object (readonly)
Whether the report template is built-in, and therefore cannot be modified.
51 52 53 |
# File 'lib/nexpose/report_template.rb', line 51 def built_in @built_in end |
#description ⇒ Object (readonly)
Description of the report template.
53 54 55 |
# File 'lib/nexpose/report_template.rb', line 53 def description @description end |
#id ⇒ Object (readonly)
The ID of the report template.
40 41 42 |
# File 'lib/nexpose/report_template.rb', line 40 def id @id end |
#name ⇒ Object (readonly)
The name of the report template.
42 43 44 |
# File 'lib/nexpose/report_template.rb', line 42 def name @name end |
#scope ⇒ Object (readonly)
The visibility (scope) of the report template. One of: global|silo
49 50 51 |
# File 'lib/nexpose/report_template.rb', line 49 def scope @scope end |
#type ⇒ Object (readonly)
One of: data|document. With a data template, you can export comma-separated value (CSV) files with vulnerability-based data. With a document template, you can create PDF, RTF, HTML, or XML reports with asset-based information.
47 48 49 |
# File 'lib/nexpose/report_template.rb', line 47 def type @type end |
Class Method Details
.parse(xml) ⇒ Object
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/nexpose/report_template.rb', line 68 def self.parse(xml) description = nil xml.elements.each('description') { |desc| description = desc.text } ReportTemplateSummary.new(xml.attributes['id'], xml.attributes['name'], xml.attributes['type'], xml.attributes['scope'], xml.attributes['builtin'] == '1', description) end |
Instance Method Details
#delete(connection) ⇒ Object
64 65 66 |
# File 'lib/nexpose/report_template.rb', line 64 def delete(connection) connection.delete_report_template(@id) end |