Class: Metanorma::Document::Relaton::FormattedAddress

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/metanorma/document/relaton/address.rb

Overview

Model for formattedAddress element which may contain mixed content with <br/> tags.

Class Method Summary collapse

Class Method Details

.from_lines(lines) ⇒ Object

Construct a FormattedAddress from an array of text lines, inserting <br/> elements between them for proper mixed-content serialization.



22
23
24
25
26
27
28
29
# File 'lib/metanorma/document/relaton/address.rb', line 22

def self.from_lines(lines)
  new.tap do |fa|
    fa.content = lines
    fa.br = lines[1..].map do
      Metanorma::Document::Components::Inline::BrElement.new
    end
  end
end