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.



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

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.



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

def raw
  @raw
end

Instance Method Details

#destroyObject



40
41
42
43
# File 'lib/openscap/xccdf/benchmark.rb', line 40

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

#itemsObject



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

def items
  @items ||= items_init
end

#profilesObject



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

def profiles
  @profiles ||= profiles_init
end