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.



6
7
8
9
10
11
# File 'lib/openscap/xccdf/fix.rb', line 6

def initialize(raw)
  raise OpenSCAP::OpenSCAPError, "Cannot initialize #{self.class.name} with '#{raw}'" \
    unless raw.is_a?(FFI::Pointer)

  @raw = raw
end

Instance Method Details

#contentObject



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

def content
  OpenSCAP.xccdf_fix_get_content(@raw)
end

#fix_systemObject

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



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

def fix_system
  OpenSCAP.xccdf_fix_get_system(@raw)
end

#idObject



13
14
15
# File 'lib/openscap/xccdf/fix.rb', line 13

def id
  OpenSCAP.xccdf_fix_get_id(@raw)
end

#platformObject



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

def platform
  OpenSCAP.xccdf_fix_get_platform(@raw)
end

#to_hashObject



30
31
32
33
34
35
36
37
# File 'lib/openscap/xccdf/fix.rb', line 30

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