Class: Pubid::Jis::Renderer

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

Overview

Human-readable renderer for JIS identifiers.

Produces strings like:

"JIS A 0001:1999"
"JIS TR Z 8301:2019"
"JIS B 3700-11:1996/CORRIGENDUM 1:2002"
"JIS K 2151:2004/EXPL"

The renderer is registered as the ‘:human` format in the JIS format registry and invoked via `render(format: :human)`.

Constant Summary collapse

PUBLISHER =
"JIS"

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



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/pubid/jis/renderer.rb', line 18

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

  case id
  when SupplementIdentifier
    render_supplement(id)
  when SingleIdentifier
    render_single(id)
  else
    render_base(id)
  end
end