Class: Coradoc::CoreModel::InlineElement
- Includes:
- ChildrenContent
- Defined in:
- lib/coradoc/core_model/inline_element.rb
Overview
Generic inline formatting element
Typed subclasses (BoldElement, ItalicElement, etc.) express their format identity via the class hierarchy — the class IS the format type. Generic InlineElement instances use the format_type attribute for typing.
Direct Known Subclasses
BoldElement, CrossReferenceElement, FootnoteElement, HardLineBreakElement, HighlightElement, ItalicElement, LineBreakElement, LinkElement, MonospaceElement, SpanElement, StemElement, StrikethroughElement, SubscriptElement, SuperscriptElement, TermElement, TextElement, UnderlineElement
Constant Summary collapse
- FORMAT_TYPES =
%w[ bold italic monospace underline strikethrough subscript superscript highlight link xref stem footnote hard_line_break text span term line_break quotation ].freeze
Instance Attribute Summary
Attributes inherited from Base
#element_attributes, #id, #metadata_entries, #title
Class Method Summary collapse
Instance Method Summary collapse
Methods included from ChildrenContent
#flat_text, included, #renderable_content
Methods inherited from Base
#accept, #attr, #metadata, #semantically_equivalent?, #set_attr, #set_metadata
Class Method Details
.format_type ⇒ Object
15 16 17 |
# File 'lib/coradoc/core_model/inline_element.rb', line 15 def self.format_type nil end |
.format_type_class(type) ⇒ Object
19 20 21 |
# File 'lib/coradoc/core_model/inline_element.rb', line 19 def self.format_type_class(type) FORMAT_TYPE_CLASS_MAP[type] || InlineElement end |
Instance Method Details
#resolve_format_type ⇒ Object
23 24 25 |
# File 'lib/coradoc/core_model/inline_element.rb', line 23 def resolve_format_type self.class.format_type || format_type end |