Class: OpenSCAP::Xccdf::Fix

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

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ Fix

Returns a new instance of Fix.



15
16
17
18
19
# File 'lib/openscap/xccdf/fix.rb', line 15

def initialize(raw)
  fail OpenSCAP::OpenSCAPError, "Cannot initialize OpenSCAP::Xccdf::Reference with '#{raw}'" \
    unless raw.is_a?(FFI::Pointer)
  @raw = raw
end

Instance Method Details

#contentObject



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

def content
  OpenSCAP.xccdf_fix_get_content(@raw)
end

#fix_systemObject

system is a reserved word in Rails, so didn’t use it



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

def fix_system
  OpenSCAP.xccdf_fix_get_system(@raw)
end

#idObject



21
22
23
# File 'lib/openscap/xccdf/fix.rb', line 21

def id
  OpenSCAP.xccdf_fix_get_id(@raw)
end

#platformObject



25
26
27
# File 'lib/openscap/xccdf/fix.rb', line 25

def platform
  OpenSCAP.xccdf_fix_get_platform(@raw)
end

#to_hashObject



38
39
40
41
42
43
44
45
# File 'lib/openscap/xccdf/fix.rb', line 38

def to_hash
  {
    :id => id,
    :platform => platform,
    :system => fix_system,
    :content => content
  }
end