Class: OpenSCAP::Xccdf::Tailoring

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, benchmark) ⇒ Tailoring

Returns a new instance of Tailoring.



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

def initialize(source, benchmark)
  case source
  when OpenSCAP::Source
    @raw = OpenSCAP.xccdf_tailoring_import_source source.raw, benchmark
  else
    raise OpenSCAP::OpenSCAPError, "Cannot initialize #{self.class.name} with '#{source}'"
  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/tailoring.rb', line 18

def raw
  @raw
end

Instance Method Details

#destroyObject



34
35
36
37
# File 'lib/openscap/xccdf/tailoring.rb', line 34

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

#profilesObject



30
31
32
# File 'lib/openscap/xccdf/tailoring.rb', line 30

def profiles
  @profiles ||= profiles_init
end