Class: OpenSCAP::Xccdf::Group
Instance Method Summary collapse
Methods inherited from Item
build, #destroy, #initialize, #rationale, #warnings
Methods included from ItemCommon
#description, #id, #references, #title, #version
Constructor Details
This class inherits a constructor from OpenSCAP::Xccdf::Item
Instance Method Details
#each_child ⇒ Object
10 11 12 13 14 |
# File 'lib/openscap/xccdf/group.rb', line 10 def each_child(&) OpenSCAP._iterate over: OpenSCAP.xccdf_item_get_content(@raw), as: 'xccdf_item' do |pointer| yield OpenSCAP::Xccdf::Item.build pointer end end |
#each_value ⇒ Object
16 17 18 19 20 |
# File 'lib/openscap/xccdf/group.rb', line 16 def each_value(&) OpenSCAP._iterate over: OpenSCAP.xccdf_group_get_values(@raw), as: 'xccdf_value' do |pointer| yield OpenSCAP::Xccdf::Value.new pointer end end |
#sub_items ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/openscap/xccdf/group.rb', line 22 def sub_items @sub_items ||= {}.tap do |sub_items| each_child do |item| sub_items.merge! item.sub_items sub_items[item.id] = item end end end |