Class: OpenSCAP::DS::Sds
- Inherits:
-
Object
- Object
- OpenSCAP::DS::Sds
- Defined in:
- lib/openscap/ds/sds.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #destroy ⇒ Object
- #html_guide(profile = nil) ⇒ Object
-
#initialize(param) ⇒ Sds
constructor
A new instance of Sds.
- #select_checklist(p = {}) ⇒ Object
- #select_checklist!(p = {}) ⇒ Object
Constructor Details
#initialize(param) ⇒ Sds
Returns a new instance of Sds.
10 11 12 13 14 15 16 17 18 |
# File 'lib/openscap/ds/sds.rb', line 10 def initialize(param) @raw = case param when OpenSCAP::Source OpenSCAP.ds_sds_session_new_from_source param.raw when Hash OpenSCAP.ds_sds_session_new_from_source param[:source].raw end OpenSCAP.raise! if @raw.null? end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
8 9 10 |
# File 'lib/openscap/ds/sds.rb', line 8 def raw @raw end |
Instance Method Details
#destroy ⇒ Object
37 38 39 40 |
# File 'lib/openscap/ds/sds.rb', line 37 def destroy OpenSCAP.ds_sds_session_free(@raw) @raw = nil end |
#html_guide(profile = nil) ⇒ Object
31 32 33 34 35 |
# File 'lib/openscap/ds/sds.rb', line 31 def html_guide(profile = nil) html = OpenSCAP.ds_sds_session_get_html_guide(@raw, profile) OpenSCAP.raise! if html.nil? html end |
#select_checklist(p = {}) ⇒ Object
20 21 22 23 |
# File 'lib/openscap/ds/sds.rb', line 20 def select_checklist(p = {}) source_p = OpenSCAP.ds_sds_session_select_checklist(@raw, p[:datastream_id], p[:component_id], nil) OpenSCAP::Source.new source_p end |
#select_checklist!(p = {}) ⇒ Object
25 26 27 28 29 |
# File 'lib/openscap/ds/sds.rb', line 25 def select_checklist!(p = {}) checklist = select_checklist(p) OpenSCAP.raise! if checklist.nil? or checklist.raw.null? checklist end |