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 |
# File 'lib/pubid/ieee/renderer.rb', line 19 def render(context: nil, **opts) # IEEE attaches the trademark mark to the document number, before the # year and every suffix ("IEEE Std 802.3®-2018"), so the mark is # emitted by whichever method renders the number rather than appended # to the finished string. A renderer instance is built per render call # (Pubid::Identifier#render), so the flag is safe as instance state. @trademark = opts[:trademark] render_id(@id) end |