Class: DocTemplate::DocumentToc

Inherits:
Object
  • Object
show all
Defined in:
lib/doc_template/document_toc.rb

Class Method Summary collapse

Class Method Details

.parse(opts = {}) ⇒ Object

Build the ToC from the first available metadata. We’re doing that to allow cross-subject data passing.



12
13
14
15
# File 'lib/doc_template/document_toc.rb', line 12

def self.parse(opts = {})
   = REGISTERED_METADATA.detect { |m| opts[m]&.children.present? }
  Objects::TocMetadata.new opts[]
end