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.



12
13
14
15
16
17
18
19
20
21
# File 'lib/openscap/xccdf/benchmark.rb', line 12

def initialize(p)
  case p
  when OpenSCAP::Source
    @raw = OpenSCAP.xccdf_benchmark_import_source p.raw
  else
    raise 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.



10
11
12
# File 'lib/openscap/xccdf/benchmark.rb', line 10

def raw
  @raw
end

Instance Method Details

#destroyObject



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

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

#itemsObject



27
28
29
# File 'lib/openscap/xccdf/benchmark.rb', line 27

def items
  @items ||= items_init
end

#profilesObject



23
24
25
# File 'lib/openscap/xccdf/benchmark.rb', line 23

def profiles
  @profiles ||= profiles_init
end