Class: OpenSCAP::Xccdf::Profile

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(p) ⇒ Profile

Returns a new instance of Profile.



19
20
21
22
23
24
25
26
# File 'lib/openscap/xccdf/profile.rb', line 19

def initialize(p)
  case p
  when FFI::Pointer
    @raw = p
  else
    fail OpenSCAP::OpenSCAPError, "Cannot initialize OpenSCAP::Xccdf::Profile with #{p}"
  end
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



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

def raw
  @raw
end

Instance Method Details

#idObject



28
29
30
# File 'lib/openscap/xccdf/profile.rb', line 28

def id
  OpenSCAP.xccdf_profile_get_id raw
end

#title(prefered_lang = nil) ⇒ Object



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

def title(prefered_lang = nil)
  textlist = OpenSCAP::TextList.new(OpenSCAP.xccdf_profile_get_title(@raw))
  title = textlist.plaintext(prefered_lang)
  textlist.destroy
  title
end