Class: OpenSCAP::Xccdf::Item
- Inherits:
-
Object
- Object
- OpenSCAP::Xccdf::Item
show all
- Includes:
- ItemCommon
- Defined in:
- lib/openscap/xccdf.rb,
lib/openscap/xccdf/item.rb
Overview
rubocop:disable Lint/EmptyClass
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from ItemCommon
#description, #id, #references, #title, #version
Constructor Details
#initialize(t) ⇒ Item
Returns a new instance of Item.
29
30
31
32
33
|
# File 'lib/openscap/xccdf/item.rb', line 29
def initialize t
raise OpenSCAP::OpenSCAPError, "Cannot initialize #{self.class.name} abstract base class." if instance_of?(OpenSCAP::Xccdf::Item)
@raw = t
end
|
Instance Method Details
#destroy ⇒ Object
52
53
54
55
|
# File 'lib/openscap/xccdf/item.rb', line 52
def destroy
OpenSCAP.xccdf_item_free @raw
@raw = nil
end
|
#rationale(prefered_lang = nil, markup: false) ⇒ Object
35
36
37
|
# File 'lib/openscap/xccdf/item.rb', line 35
def rationale prefered_lang = nil, markup: false
TextList.(OpenSCAP.xccdf_item_get_rationale(@raw), lang: prefered_lang, markup:)
end
|
#sub_items ⇒ Object
50
|
# File 'lib/openscap/xccdf/item.rb', line 50
def sub_items = {}
|
#warnings ⇒ Object
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/openscap/xccdf/item.rb', line 39
def warnings
@warnings ||= [].tap do |warns|
OpenSCAP._iterate over: OpenSCAP.xccdf_item_get_warnings(@raw), as: 'xccdf_warning' do |pointer|
warns << {
category: OpenSCAP.xccdf_warning_get_category(pointer),
text: Text.new(OpenSCAP.xccdf_warning_get_text(pointer))
}
end
end
end
|