Class: OpenSCAP::Xccdf::Policy
- Inherits:
-
Object
- Object
- OpenSCAP::Xccdf::Policy
- Defined in:
- lib/openscap/xccdf/policy.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(p) ⇒ Policy
constructor
A new instance of Policy.
- #profile ⇒ Object
- #selects_item?(item_idref) ⇒ Boolean
Constructor Details
#initialize(p) ⇒ Policy
Returns a new instance of Policy.
10 11 12 13 14 15 16 17 18 |
# File 'lib/openscap/xccdf/policy.rb', line 10 def initialize(p) case p when FFI::Pointer @raw = p else raise OpenSCAP::OpenSCAPError, "Cannot initialize OpenSCAP::Xccdf::Policy with '#{p}'" 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/xccdf/policy.rb', line 8 def raw @raw end |
Instance Method Details
#id ⇒ Object
20 21 22 |
# File 'lib/openscap/xccdf/policy.rb', line 20 def id OpenSCAP.xccdf_policy_get_id @raw end |
#profile ⇒ Object
24 25 26 |
# File 'lib/openscap/xccdf/policy.rb', line 24 def profile Profile.new OpenSCAP.xccdf_policy_get_profile @raw end |
#selects_item?(item_idref) ⇒ Boolean
28 29 30 |
# File 'lib/openscap/xccdf/policy.rb', line 28 def selects_item? item_idref OpenSCAP.xccdf_policy_is_item_selected @raw, item_idref end |