Class: Coradoc::Oscal
- Inherits:
-
Object
- Object
- Coradoc::Oscal
- Defined in:
- lib/coradoc/oscal.rb
Instance Attribute Summary collapse
-
#_doc ⇒ Object
readonly
Returns the value of attribute _doc.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(document) ⇒ Oscal
constructor
A new instance of Oscal.
- #to_oscal ⇒ Object
Constructor Details
#initialize(document) ⇒ Oscal
Returns a new instance of Oscal.
7 8 9 |
# File 'lib/coradoc/oscal.rb', line 7 def initialize(document) @_doc = document end |
Instance Attribute Details
#_doc ⇒ Object (readonly)
Returns the value of attribute _doc.
5 6 7 |
# File 'lib/coradoc/oscal.rb', line 5 def _doc @_doc end |
Class Method Details
.to_oscal(document) ⇒ Object
11 12 13 |
# File 'lib/coradoc/oscal.rb', line 11 def self.to_oscal(document) new(document).to_oscal end |
Instance Method Details
#to_oscal ⇒ Object
15 16 17 18 19 20 |
# File 'lib/coradoc/oscal.rb', line 15 def to_oscal { "metadata" => _doc.document_attributes.to_hash, "groups" => sections_as_groups, } end |