Class: Idml::Elements::CharacterStyleRange
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Idml::Elements::CharacterStyleRange
- Defined in:
- lib/idml/elements/character_style_range.rb
Overview
Typed model of <CharacterStyleRange>. Every
attribute from CharacterStyleRange_Object in
reference-docs/schemas/package/Stories/Story.rnc is declared (284 attributes),
generated by scripts/rnc_to_lutaml.rb.
Instance Method Summary collapse
-
#attributed_text ⇒ Object
Returns an array of source_self: tuples.
- #each_xml_element(&block) ⇒ Object
- #text_content ⇒ Object
Instance Method Details
#attributed_text ⇒ Object
Returns an array of source_self: tuples. Plain Content chars have source_self == nil; chars inside a HyperlinkTextSource carry the source's Self attribute. Used by HyperlinkEmitter to compute per-source link rects.
671 672 673 674 675 676 677 |
# File 'lib/idml/elements/character_style_range.rb', line 671 def attributed_text result = [] append_plain_content(result) append_hyperlink_content(result) append_nested_csr(result) result end |
#each_xml_element(&block) ⇒ Object
700 701 702 703 704 705 706 |
# File 'lib/idml/elements/character_style_range.rb', line 700 def each_xml_element(&block) xml_element.each do |e| yield e e.each_xml_element(&block) end character_style_range.each { |c| c.each_xml_element(&block) } end |
#text_content ⇒ Object
660 661 662 663 664 665 |
# File 'lib/idml/elements/character_style_range.rb', line 660 def text_content parts = content.map(&:text) hyperlink_text_source.each { |s| parts << s.text_content } character_style_range.each { |c| parts << c.text_content } parts.join end |