Class: Pubid::Iana::Renderer

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

Overview

Human-readable renderer for IANA registry identifiers.

Produces the authoritative printed form:

"IANA _6lowpan-parameters"
"IANA _6lowpan-parameters/lowpan_nhc"

With with_publisher: false on the identifier it renders the bare index-key slug instead (no "IANA " token).

Constant Summary collapse

PUBLISHER =
"IANA"

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(**_opts) ⇒ Object



16
17
18
19
20
# File 'lib/pubid/iana/renderer.rb', line 16

def render(**_opts)
  id = @id
  code = id.code
  with_publisher?(id) ? "#{PUBLISHER} #{code}" : code
end