Class: OpenSCAP::Xccdf::PolicyModel
- Inherits:
-
Object
- Object
- OpenSCAP::Xccdf::PolicyModel
- Defined in:
- lib/openscap/xccdf/policy_model.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(b) ⇒ PolicyModel
constructor
A new instance of PolicyModel.
- #policies ⇒ Object
Constructor Details
#initialize(b) ⇒ PolicyModel
Returns a new instance of PolicyModel.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/openscap/xccdf/policy_model.rb', line 12 def initialize(b) case b when OpenSCAP::Xccdf::Benchmark @raw = OpenSCAP.xccdf_policy_model_new(b.raw) else raise OpenSCAP::OpenSCAPError, "Cannot initialize OpenSCAP::Xccdf::PolicyModel with '#{b}'" end OpenSCAP.raise! if @raw.null? end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
10 11 12 |
# File 'lib/openscap/xccdf/policy_model.rb', line 10 def raw @raw end |
Instance Method Details
#destroy ⇒ Object
27 28 29 30 |
# File 'lib/openscap/xccdf/policy_model.rb', line 27 def destroy OpenSCAP.xccdf_policy_model_free @raw @raw = nil end |
#policies ⇒ Object
23 24 25 |
# File 'lib/openscap/xccdf/policy_model.rb', line 23 def policies @policies ||= policies_init end |