Class: Openvas::Reports

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

Constant Summary

Constants inherited from Client

Client::BLOCK_SIZE

Class Method Summary collapse

Methods inherited from Client

connect, disconnect, query, version

Class Method Details

.allObject



7
8
9
10
11
12
# File 'lib/openvas/reports.rb', line 7

def self.all
  query = Nokogiri::XML::Builder.new { get_reports }
  query(query).xpath('//get_reports_response/report').map do |report|
    Openvas::Report.new(report)
  end
end

.find_by_id(id) ⇒ Object



14
15
16
17
# File 'lib/openvas/reports.rb', line 14

def self.find_by_id(id)
  query = Nokogiri::XML::Builder.new { get_reports(report_id: id) }
  Openvas::Report.new(query(query).at_xpath('//get_reports_response/report'))
end