Sha256: 22ce86c025199dec960830f2cffdba7a83e8630016bfa269118db0ca54734d75

Contents?: true

Size: 466 Bytes

Versions: 9

Compression:

Stored size: 466 Bytes

Contents

# frozen_string_literal: true

module DocTemplate
  class DocumentToc
    REGISTERED_METADATA = %i(agenda sections).freeze
    private_constant :REGISTERED_METADATA

    #
    # Build the ToC from the first available metadata.
    # We're doing that to allow cross-subject data passing.
    #
    def self.parse(opts = {})
      metadata = REGISTERED_METADATA.detect { |m| opts[m]&.children.present? }
      Objects::TocMetadata.new opts[metadata]
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
lcms-engine-0.5.5 lib/doc_template/document_toc.rb
lcms-engine-0.5.4 lib/doc_template/document_toc.rb
lcms-engine-0.5.3 lib/doc_template/document_toc.rb
lcms-engine-0.5.2 lib/doc_template/document_toc.rb
lcms-engine-0.5.1 lib/doc_template/document_toc.rb
lcms-engine-0.5.0 lib/doc_template/document_toc.rb
lcms-engine-0.4.2 lib/doc_template/document_toc.rb
lcms-engine-0.4.1 lib/doc_template/document_toc.rb
lcms-engine-0.4.0 lib/doc_template/document_toc.rb