Class: OpenSCAP::Xccdf::Rule
Instance Method Summary collapse
Methods inherited from Item
build, #description, #destroy, #id, #initialize, #rationale, #references, #sub_items, #title
Constructor Details
This class inherits a constructor from OpenSCAP::Xccdf::Item
Instance Method Details
#fixes ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/openscap/xccdf/rule.rb', line 32 def fixes fixes = [] items_it = OpenSCAP.xccdf_rule_get_fixes(@raw) while OpenSCAP.xccdf_fix_iterator_has_more items_it fixes << OpenSCAP::Xccdf::Fix.new(OpenSCAP.xccdf_fix_iterator_next(items_it)) end OpenSCAP.xccdf_fix_iterator_free items_it fixes end |
#severity ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/openscap/xccdf/rule.rb', line 19 def severity severity = OpenSCAP.xccdf_rule_get_severity(@raw) severity_mapping = { :xccdf_level_not_defined => 'Not defined', :xccdf_unknown => 'Unknown', :xccdf_info => 'Info', :xccdf_low => 'Low', :xccdf_medium => 'Medium', :xccdf_high => 'High' } severity_mapping[severity] ? severity_mapping[severity] : severity_mapping[:xccdf_unknown] end |