Class: OpenSCAP::Xccdf::Benchmark

Inherits:
Object
  • Object
show all
Defined in:
lib/openscap/xccdf/benchmark.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(p) ⇒ Benchmark

Returns a new instance of Benchmark.



20
21
22
23
24
25
26
27
28
29
# File 'lib/openscap/xccdf/benchmark.rb', line 20

def initialize(p)
  case p
  when OpenSCAP::Source
    @raw = OpenSCAP.xccdf_benchmark_import_source p.raw
  else
    fail OpenSCAP::OpenSCAPError,
         "Cannot initialize OpenSCAP::Xccdf::Benchmark with '#{p}'"
  end
  OpenSCAP.raise! if @raw.null?
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



18
19
20
# File 'lib/openscap/xccdf/benchmark.rb', line 18

def raw
  @raw
end

Instance Method Details

#destroyObject



35
36
37
38
# File 'lib/openscap/xccdf/benchmark.rb', line 35

def destroy
  OpenSCAP.xccdf_benchmark_free @raw
  @raw = nil
end

#profilesObject



31
32
33
# File 'lib/openscap/xccdf/benchmark.rb', line 31

def profiles
  @profiles ||= profiles_init
end