Class: Coradoc::CoreModel::TextContent

Inherits:
Base
  • Object
show all
Defined in:
lib/coradoc/core_model/text_content.rb

Overview

Wrapper for plain-text strings in mixed-content children arrays.

Enables every child in a children collection to be a typed Base instance, so that children can be declared as

attribute :children, Base, collection: true

matching StructuralElement’s proven pattern.

Examples:

TextContent.new(text: "Hello, world")

Instance Attribute Summary

Attributes inherited from Base

#element_attributes, #id, #metadata_entries, #title

Instance Method Summary collapse

Methods inherited from Base

#accept, #attr, #metadata, #semantically_equivalent?, #set_attr, #set_metadata

Instance Method Details

#to_sObject



17
18
19
# File 'lib/coradoc/core_model/text_content.rb', line 17

def to_s
  text.to_s
end