Class: Pubid::Isbn::Renderer

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

Overview

Human-readable renderer for ISBN identifiers.

Preserves the original hyphenation when present; otherwise emits the bare digits. Always emits the "ISBN " prefix.

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



10
11
12
13
# File 'lib/pubid/isbn/renderer.rb', line 10

def render(**_opts)
  body = @id.hyphenated || @id.raw
  "ISBN #{body}"
end