class Proxy::OpenSCAP::OvalReportStorageFs

Public Class Methods

new(path_to_dir, oval_policy_id, cname, reported_at) click to toggle source
# File lib/smart_proxy_openscap/oval_report_storage_fs.rb, line 8
def initialize(path_to_dir, oval_policy_id, cname, reported_at)
  @namespace = 'oval'
  @reported_at = reported_at
  @path = "#{path_to_dir}/#{@namespace}/#{oval_policy_id}/#{cname}/"
end

Public Instance Methods

store_report(report_data) click to toggle source
# File lib/smart_proxy_openscap/oval_report_storage_fs.rb, line 14
def store_report(report_data)
  store(report_data, StoreReportError)
end

Private Instance Methods

store_file(path_to_store, report_data) click to toggle source
# File lib/smart_proxy_openscap/oval_report_storage_fs.rb, line 20
def store_file(path_to_store, report_data)
  target_path = "#{path_to_store}#{@reported_at}"
  File.open(target_path, 'w') { |f| f.write(report_data) }
  target_path
end