Class: Pubid::Ieee::Renderer
- Inherits:
-
Renderers::Base
- Object
- Renderers::Base
- Pubid::Ieee::Renderer
- Defined in:
- lib/pubid/ieee/renderer.rb
Overview
Human-readable renderer for IEEE identifiers.
Produces strings like:
"IEEE Std 802.11-2020"
"IEEE Std 535-2013/Cor. 1-2017"
"ANSI C37.61-1973 and IEEE Std 321-1973"
The renderer is registered as the :human format in the IEEE format registry and invoked via render(format: :human).
For wrapper types (DualPublished, AdoptedStandard, etc.) the renderer composes child identifiers. For simple identifiers it delegates to the identifier’s own publisher/code/relationship helpers.
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
Constructor Details
This class inherits a constructor from Pubid::Renderers::Base
Instance Method Details
#render(context: nil, **opts) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/pubid/ieee/renderer.rb', line 19 def render(context: nil, **opts) id = @id case id when Identifiers::DualPublished render_dual_published(id) when Identifiers::DualIdentifier render_dual_identifier(id) when Identifiers::AdoptedStandard render_adopted_standard(id) when Identifiers::RedlinedStandard render_redlined_standard(id) when Identifiers::Corrigendum render_corrigendum(id) when Identifiers::InterpretationIdentifier render_interpretation(id) when Identifiers::ConformanceIdentifier render_conformance(id) when Identifiers::MultiNumberedIdentifier render_multi_numbered(id) when Identifiers::ParentheticalIdentifier render_parenthetical(id) when Identifiers::CsaDualPublished render_csa_dual_published(id) when Identifiers::IecIeeeCopublished render_iec_ieee_copublished(id) when Identifiers::SiStandard render_si_standard(id) when Identifiers::JointDevelopment id.to_s else render_base(id) end end |