Class: Pubid::Renderers::Base
- Inherits:
-
Object
- Object
- Pubid::Renderers::Base
- Defined in:
- lib/pubid/renderers/base.rb
Direct Known Subclasses
Constant Summary collapse
- SEMANTIC_SPLIT =
Partitions a value into (leading separators, core, trailing separators) so “- : / space , .” stay OUTSIDE the annotation span (v1 parity).
%r{\A([-:/ ,.]*)(.*?)([-:/ ,.]*)\z}m- TYPED_STAGE_CSS =
type_code (a string) → semantic CSS class for the typed-stage token. Anything not listed (and not the default “is”) renders as “doctype”.
{ "amd" => "amendment", "cor" => "corrigendum", "add" => "addendum", }.freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(identifier) ⇒ Base
constructor
A new instance of Base.
- #render ⇒ Object
Constructor Details
#initialize(identifier) ⇒ Base
Returns a new instance of Base.
6 7 8 |
# File 'lib/pubid/renderers/base.rb', line 6 def initialize(identifier) @id = identifier end |
Class Method Details
.render(identifier) ⇒ Object
14 15 16 |
# File 'lib/pubid/renderers/base.rb', line 14 def self.render(identifier) new(identifier).render end |
Instance Method Details
#render ⇒ Object
10 11 12 |
# File 'lib/pubid/renderers/base.rb', line 10 def render raise NotImplementedError, "#{self.class}#render not implemented" end |