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.
19 20 21 22 23 24 25 26 27 |
# File 'lib/openscap/ds/sds.rb', line 19 def initialize(param) @raw = case param when OpenSCAP::Source @raw = OpenSCAP.ds_sds_session_new_from_source param.raw when Hash @raw = 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.
17 18 19 |
# File 'lib/openscap/ds/sds.rb', line 17 def raw @raw end |
Instance Method Details
#destroy ⇒ Object
46 47 48 49 |
# File 'lib/openscap/ds/sds.rb', line 46 def destroy OpenSCAP.ds_sds_session_free(@raw) @raw = nil end |
#html_guide(profile = nil) ⇒ Object
40 41 42 43 44 |
# File 'lib/openscap/ds/sds.rb', line 40 def html_guide(profile=nil) html = OpenSCAP.ds_sds_session_get_html_guide(@raw, profile) OpenSCAP.raise! if html.nil? return html end |
#select_checklist(p = {}) ⇒ Object
29 30 31 32 |
# File 'lib/openscap/ds/sds.rb', line 29 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
34 35 36 37 38 |
# File 'lib/openscap/ds/sds.rb', line 34 def select_checklist!(p={}) checklist = select_checklist(p) OpenSCAP.raise! if checklist.nil? or checklist.raw.null? return checklist end |