Class: Coradoc::Oscal

Inherits:
Object
  • Object
show all
Defined in:
lib/coradoc/oscal.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#_docObject (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_oscalObject



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