Class: OpenSCAP::Xccdf::Reference

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

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ Reference

Returns a new instance of Reference.



6
7
8
9
10
# File 'lib/openscap/xccdf/reference.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

#hrefObject



13
# File 'lib/openscap/xccdf/reference.rb', line 13

def href = OpenSCAP.oscap_reference_get_href @raw


14
# File 'lib/openscap/xccdf/reference.rb', line 14

def html_link = "<a href='#{href}'>#{title}</a>"

#titleObject



12
# File 'lib/openscap/xccdf/reference.rb', line 12

def title = OpenSCAP.oscap_reference_get_title @raw

#to_hashObject



15
# File 'lib/openscap/xccdf/reference.rb', line 15

def to_hash = { title:, href:, html_link: }