Class: Coradoc::CoreModel::Block
- Includes:
- ChildrenContent
- Defined in:
- lib/coradoc/core_model/block.rb
Overview
Generic delimited block model
Represents all standard AsciiDoc delimited blocks including:
-
Example blocks (====)
-
Literal blocks (““)
-
Listing blocks (—-)
-
Open blocks (–)
-
Pass blocks (++++/++++)
-
Quote blocks (__)
-
Sidebar blocks (****)
-
Source blocks (—-)
-
Paragraphs (element_type: ‘paragraph’)
This is a schema-agnostic representation that captures the semantic structure without schema-specific interpretation.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#content ⇒ String?
The block’s text content (simple string) For mixed content with inline elements, use children instead.
-
#delimiter_length ⇒ Integer
Number of delimiter characters (default: 4).
-
#delimiter_type ⇒ String?
The delimiter character(s) used (e.g., ‘****’, ‘====’, ‘—-’).
-
#element_type ⇒ String?
The semantic type of the block (e.g., ‘paragraph’, ‘block’).
-
#language ⇒ String?
Language identifier for source code blocks.
-
#lines ⇒ Array<String>?
Individual lines of content.
Attributes inherited from Base
#element_attributes, #id, #metadata_entries, #title
Method Summary
Methods included from ChildrenContent
#children=, #flat_text, included, #initialize, #renderable_content, #to_hash
Methods inherited from Base
#accept, #attr, #metadata, #semantically_equivalent?, #set_attr, #set_metadata
Instance Attribute Details
#content ⇒ String?
Returns the block’s text content (simple string) For mixed content with inline elements, use children instead.
64 |
# File 'lib/coradoc/core_model/block.rb', line 64 attribute :content, :string |
#delimiter_length ⇒ Integer
Returns number of delimiter characters (default: 4).
59 |
# File 'lib/coradoc/core_model/block.rb', line 59 attribute :delimiter_length, :integer, default: -> { 4 } |
#delimiter_type ⇒ String?
Returns the delimiter character(s) used (e.g., ‘****’, ‘====’, ‘—-’).
55 |
# File 'lib/coradoc/core_model/block.rb', line 55 attribute :delimiter_type, :string |
#element_type ⇒ String?
Returns the semantic type of the block (e.g., ‘paragraph’, ‘block’).
50 |
# File 'lib/coradoc/core_model/block.rb', line 50 attribute :element_type, :string |
#language ⇒ String?
Returns language identifier for source code blocks.
72 |
# File 'lib/coradoc/core_model/block.rb', line 72 attribute :language, :string |
#lines ⇒ Array<String>?
Returns individual lines of content.
68 |
# File 'lib/coradoc/core_model/block.rb', line 68 attribute :lines, :string, collection: true |