Class: OpenSCAP::Source

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

Instance Method Summary collapse

Constructor Details

#initialize(input_filename) ⇒ Source

Returns a new instance of Source.

Raises:



14
15
16
17
18
19
20
# File 'lib/openscap/source.rb', line 14

def initialize(input_filename)
  raise OpenSCAPError, "No filename specified!" unless input_filename
  @s = OpenSCAP.oscap_source_new_from_file(input_filename)
  if @s.null?
    OpenSCAP.raise!
  end
end

Instance Method Details

#destroyObject



26
27
28
29
# File 'lib/openscap/source.rb', line 26

def destroy
  OpenSCAP.oscap_source_free(@s)
  @s = nil
end

#rawObject



22
23
24
# File 'lib/openscap/source.rb', line 22

def raw
  @s
end