Class: OpenSCAP::Xccdf::TestResult
- Inherits:
-
Object
- Object
- OpenSCAP::Xccdf::TestResult
- Defined in:
- lib/openscap/xccdf/testresult.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#rr ⇒ Object
readonly
Returns the value of attribute rr.
Instance Method Summary collapse
- #destroy ⇒ Object
- #id ⇒ Object
-
#initialize(t) ⇒ TestResult
constructor
A new instance of TestResult.
- #profile ⇒ Object
- #score ⇒ Object
- #score!(benchmark) ⇒ Object
- #source ⇒ Object
Constructor Details
#initialize(t) ⇒ TestResult
Returns a new instance of TestResult.
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/openscap/xccdf/testresult.rb', line 23 def initialize(t) case t when OpenSCAP::Source @raw = OpenSCAP.xccdf_result_import_source(t.raw) OpenSCAP.raise! if @raw.null? when FFI::Pointer @raw = OpenSCAP.xccdf_result_import_source(t) OpenSCAP.raise! if @raw.null? else fail OpenSCAP::OpenSCAPError, "Cannot initialize TestResult with #{t}" end init_ruleresults end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
21 22 23 |
# File 'lib/openscap/xccdf/testresult.rb', line 21 def raw @raw end |
#rr ⇒ Object (readonly)
Returns the value of attribute rr.
20 21 22 |
# File 'lib/openscap/xccdf/testresult.rb', line 20 def rr @rr end |
Instance Method Details
#destroy ⇒ Object
61 62 63 64 |
# File 'lib/openscap/xccdf/testresult.rb', line 61 def destroy OpenSCAP.xccdf_result_free @raw @raw = nil end |
#id ⇒ Object
37 38 39 |
# File 'lib/openscap/xccdf/testresult.rb', line 37 def id OpenSCAP.xccdf_result_get_id(@raw) end |
#profile ⇒ Object
41 42 43 |
# File 'lib/openscap/xccdf/testresult.rb', line 41 def profile OpenSCAP.xccdf_result_get_profile(@raw) end |
#score ⇒ Object
45 46 47 |
# File 'lib/openscap/xccdf/testresult.rb', line 45 def score @score ||= score_init end |