Class: Pubid::Gost::Renderer

Inherits:
Renderers::Base show all
Defined in:
lib/pubid/gost/renderer.rb

Overview

Human-readable renderer for GOST identifiers.

Produces canonical Latin-script citations:

"GOST 14946-82"
"GOST R 34.12-2015"
"GOST ISO 9692-1"
"GOST R ISO/IEC ISP 10609-9-95"
"GOST R 58904-2020/ISO/TR 25901-1:2016"

Constant Summary

Constants inherited from Renderers::Base

Renderers::Base::SEMANTIC_SPLIT, Renderers::Base::TYPED_STAGE_CSS

Instance Method Summary collapse

Methods inherited from Renderers::Base

#initialize, render

Constructor Details

This class inherits a constructor from Pubid::Renderers::Base

Instance Method Details

#render(context: nil, **_opts) ⇒ Object

Raises:

  • (ArgumentError)


14
15
16
17
18
19
20
21
22
# File 'lib/pubid/gost/renderer.rb', line 14

def render(context: nil, **_opts)
  id = @id

  return render_harmonized(id) if id.is_a?(Identifiers::Harmonized)
  return render_identical_adoption(id) if id.is_a?(Identifiers::IdenticalAdoption)
  return render_standard(id)

  raise ArgumentError, "Unknown GOST identifier class: #{id.class}"
end