Class: Utils::ToXCCDF
Overview
Data conversions for Inspec output into XCCDF format.
Instance Method Summary collapse
-
#initialize(attribute, data) ⇒ ToXCCDF
constructor
A new instance of ToXCCDF.
-
#to_xml(metadata) ⇒ Object
Build entire XML document and produce final output.
Constructor Details
#initialize(attribute, data) ⇒ ToXCCDF
Returns a new instance of ToXCCDF.
8 9 10 11 12 |
# File 'lib/utilities/xccdf/to_xccdf.rb', line 8 def initialize(attribute, data) @attribute = attribute @data = data @benchmark = HappyMapperTools::Benchmark::Benchmark.new end |
Instance Method Details
#to_xml(metadata) ⇒ Object
Build entire XML document and produce final output
16 17 18 19 20 21 22 |
# File 'lib/utilities/xccdf/to_xccdf.rb', line 16 def to_xml() build_benchmark_header build_groups # Only populate results if a target is defined so that conformant XML is produced. @benchmark.testresult = build_test_results() if ['fqdn'] @benchmark.to_xml end |