Class: OpenSCAP::Xccdf::Reference
- Inherits:
-
Object
- Object
- OpenSCAP::Xccdf::Reference
- Defined in:
- lib/openscap/xccdf/reference.rb
Instance Method Summary collapse
- #href ⇒ Object
- #html_link ⇒ Object
-
#initialize(raw) ⇒ Reference
constructor
A new instance of Reference.
- #title ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(raw) ⇒ Reference
Returns a new instance of Reference.
6 7 8 9 10 11 |
# 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
#href ⇒ Object
17 18 19 |
# File 'lib/openscap/xccdf/reference.rb', line 17 def href OpenSCAP.oscap_reference_get_href(@raw) end |
#html_link ⇒ Object
21 22 23 |
# File 'lib/openscap/xccdf/reference.rb', line 21 def html_link "<a href='#{href}'>#{title}</a>" end |
#title ⇒ Object
13 14 15 |
# File 'lib/openscap/xccdf/reference.rb', line 13 def title OpenSCAP.oscap_reference_get_title(@raw) end |
#to_hash ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/openscap/xccdf/reference.rb', line 25 def to_hash { :title => title, :href => href, :html_link => html_link } end |