Class: OpenSCAP::DS::Arf
- Inherits:
-
Object
- Object
- OpenSCAP::DS::Arf
- Defined in:
- lib/openscap/ds/arf.rb
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #destroy ⇒ Object
- #html ⇒ Object
-
#initialize(param) ⇒ Arf
constructor
A new instance of Arf.
- #report_request(id = nil) ⇒ Object
- #test_result(id = nil) ⇒ Object
- #test_result=(tr) ⇒ Object
Constructor Details
#initialize(param) ⇒ Arf
Returns a new instance of Arf.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/openscap/ds/arf.rb', line 22 def initialize(param) case param when String, Hash @source = OpenSCAP::Source.new(param) @session = OpenSCAP.ds_rds_session_new_from_source @source.raw else fail OpenSCAP::OpenSCAPError, "Cannot initialize OpenSCAP::DS:Arf with '#{param}'" end OpenSCAP.raise! if @session.null? end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
20 21 22 |
# File 'lib/openscap/ds/arf.rb', line 20 def source @source end |
Instance Method Details
#destroy ⇒ Object
33 34 35 36 37 |
# File 'lib/openscap/ds/arf.rb', line 33 def destroy OpenSCAP.ds_rds_session_free(@session) @session = nil @source.destroy end |
#html ⇒ Object
56 57 58 59 60 61 62 63 |
# File 'lib/openscap/ds/arf.rb', line 56 def html html_p = OpenSCAP.ds_rds_session_get_html_report @session OpenSCAP.raise! if OpenSCAP.error? return nil if html_p.null? html = html_p.read_string OpenSCAP::LibC.free html_p html end |
#report_request(id = nil) ⇒ Object
50 51 52 53 54 |
# File 'lib/openscap/ds/arf.rb', line 50 def report_request(id = nil) source_p = OpenSCAP.ds_rds_session_select_report_request(@session, id) source = OpenSCAP::Source.new source_p OpenSCAP::DS::Sds.new(source) end |