Class: BenchmarkFactory
- Inherits:
-
Object
- Object
- BenchmarkFactory
- Defined in:
- lib/audit/lib/benchmark/benchmark_factory.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ BenchmarkFactory
constructor
A new instance of BenchmarkFactory.
- #load(options) ⇒ Object
Constructor Details
#initialize(options) ⇒ BenchmarkFactory
Returns a new instance of BenchmarkFactory.
4 5 6 7 8 9 10 |
# File 'lib/audit/lib/benchmark/benchmark_factory.rb', line 4 def initialize() if [:logger] then @logger = [:logger] else @logger = Logger.new(STDOUT) end end |
Instance Method Details
#load(options) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/audit/lib/benchmark/benchmark_factory.rb', line 12 def load() raise "Need option :benchmark" unless [:benchmark] if [:benchmark] =~ /\.xml$/ then return XccdfBenchmark.new({:benchmark => [:benchmark], :logger => @logger}) elsif [:benchmark] =~ /\.zip$/ then return YamlBenchmark.new({:benchmark => [:benchmark], :logger => @logger}) else raise "Unknown benchmark type" end end |