Class: Metanorma::Iso::Sts::Transformer::BodyTransformer

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

Instance Method Summary collapse

Instance Method Details

#transform(source) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/metanorma/iso/sts/transformer/body_transformer.rb', line 7

def transform(source)
  build_ordered(::Sts::IsoSts::Body) do |body|
    sections = source.sections
    next unless sections

    dispatcher = block_dispatcher
    sections.each_mixed_content do |node|
      next if node.is_a?(String)

      dispatch_body_node(node, body, dispatcher)
    end
  end
end