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.
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/openscap/xccdf/testresult.rb', line 14 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 raise OpenSCAP::OpenSCAPError, "Cannot initialize #{self.class.name} with #{t}" end init_ruleresults end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
12 13 14 |
# File 'lib/openscap/xccdf/testresult.rb', line 12 def raw @raw end |
#rr ⇒ Object (readonly)
Returns the value of attribute rr.
11 12 13 |
# File 'lib/openscap/xccdf/testresult.rb', line 11 def rr @rr end |
Instance Method Details
#destroy ⇒ Object
52 53 54 55 |
# File 'lib/openscap/xccdf/testresult.rb', line 52 def destroy OpenSCAP.xccdf_result_free @raw @raw = nil end |
#id ⇒ Object
28 29 30 |
# File 'lib/openscap/xccdf/testresult.rb', line 28 def id OpenSCAP.xccdf_result_get_id(@raw) end |
#profile ⇒ Object
32 33 34 |
# File 'lib/openscap/xccdf/testresult.rb', line 32 def profile OpenSCAP.xccdf_result_get_profile(@raw) end |
#score ⇒ Object
36 37 38 |
# File 'lib/openscap/xccdf/testresult.rb', line 36 def score @score ||= score_init end |