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.



10
11
12
13
14
15
16
17
# File 'lib/openscap/xccdf/profile.rb', line 10

def initialize(p)
  case p
  when FFI::Pointer
    @raw = p
  else
    raise OpenSCAP::OpenSCAPError, "Cannot initialize #{self.class.name} with #{p}"
  end
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



8
9
10
# File 'lib/openscap/xccdf/profile.rb', line 8

def raw
  @raw
end

Instance Method Details

#idObject



19
20
21
# File 'lib/openscap/xccdf/profile.rb', line 19

def id
  OpenSCAP.xccdf_profile_get_id raw
end

#title(prefered_lang = nil) ⇒ Object



23
24
25
26
27
28
# File 'lib/openscap/xccdf/profile.rb', line 23

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