Class: Metanorma::Iso::Sts::Transformer::ParagraphTransformer

Inherits:
Transformer::Base
  • Object
show all
Defined in:
lib/metanorma/iso/sts/transformer/paragraph_transformer.rb

Instance Method Summary collapse

Instance Method Details

#transform(source) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/metanorma/iso/sts/transformer/paragraph_transformer.rb', line 7

def transform(source)
  ::Sts::IsoSts::Paragraph.new do |p|
    p.id = paragraph_id(source)
    p.content_type = source.type_attr if source.type_attr
    p.content_type = source.class_attr if source.class_attr && !p.content_type

    inline_transformer.apply_inline_content(source, p)
  end
end