Module: Metanorma::StandardDocument::BlockAttributes
- Defined in:
- lib/metanorma/standard_document/block_attributes.rb
Overview
Mixin that declares individually-typed block collection attributes for section-level models (ClauseSection, AnnexSection, ContentSection, etc.).
Include this module in any Serializable class that represents a section body containing heterogeneous block-level content (paragraphs, tables, figures, etc.).
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/metanorma/standard_document/block_attributes.rb', line 12 def self.included(base) base.class_eval do attribute :paragraphs, Metanorma::Document::Components::Paragraphs::ParagraphBlock, collection: true attribute :unordered_lists, Metanorma::Document::Components::Lists::UnorderedList, collection: true attribute :ordered_lists, Metanorma::Document::Components::Lists::OrderedList, collection: true attribute :tables, Metanorma::Document::Components::Tables::TableBlock, collection: true attribute :figures, Metanorma::Document::Components::AncillaryBlocks::FigureBlock, collection: true attribute :formulas, Metanorma::Document::Components::AncillaryBlocks::FormulaBlock, collection: true attribute :examples, Metanorma::Document::Components::AncillaryBlocks::ExampleBlock, collection: true attribute :notes, Metanorma::Document::Components::Blocks::NoteBlock, collection: true attribute :admonitions, Metanorma::Document::Components::MultiParagraph::AdmonitionBlock, collection: true attribute :sourcecode_blocks, Metanorma::Document::Components::AncillaryBlocks::SourcecodeBlock, collection: true attribute :quote_blocks, Metanorma::Document::Components::MultiParagraph::QuoteBlock, collection: true attribute :definition_lists, Metanorma::Document::Components::Lists::DefinitionList, collection: true end end |