Class: Metanorma::Iso::Sts::Transformer::Standard

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

Overview

Adapter conforming the STS transformer to the metanorma-core document_transformers contract: .new(model, options) plus #transform returning a target (+::Sts::IsoSts::Standard+) that responds to #to_xml. It hides the Context construction behind the (model, options) signature, so the metanorma-core driver treats STS exactly like any other document-model transformer.

Instance Method Summary collapse

Constructor Details

#initialize(model, options = {}) ⇒ Standard

Returns a new instance of Standard.

Parameters:

  • model (Object)

    a metanorma-document model (+Metanorma::IsoDocument::Root+), as returned by the reader's .from_xml.

  • options (Hash) (defaults to: {})

    processor options (accepted for interface conformance; not yet consumed).



19
20
21
22
# File 'lib/metanorma/iso/sts/transformer/standard.rb', line 19

def initialize(model, options = {})
  @model = model
  @options = options
end

Instance Method Details

#transform::Sts::IsoSts::Standard

Returns the STS output model, which responds to #to_xml.

Returns:

  • (::Sts::IsoSts::Standard)

    the STS output model, which responds to #to_xml.



26
27
28
# File 'lib/metanorma/iso/sts/transformer/standard.rb', line 26

def transform
  Transformer.transform(@model)
end