Class: Pubid::Iso::UrnGenerator
- Inherits:
-
Object
- Object
- Pubid::Iso::UrnGenerator
- Defined in:
- lib/pubid/iso/urn_generator.rb
Overview
Generates RFC 5141-bis compliant URNs from ISO identifiers
RFC 5141-bis extensions implemented:
-
Explicit language specification (explicit > implicit)
-
Extended copublisher syntax (dynamic combinations)
-
Extended document types (DIR, DIR-SUP, IWA-SUP)
-
Typed stage codes (WD, CD, DIS, FDIS, PDAM, etc.)
-
Supplement chain ordering semantics
-
Bundled identifier syntax
Constant Summary collapse
- TYPED_STAGE_MAP =
Stage code mapping for RFC 5141-bis typed stages Maps TypedStage stage_code to URN stage abbreviation
{ wd: "WD", # Working Draft wds: "WDS", # Working Draft Study cd: "CD", # Committee Draft cdv: "CDV", # Committee Draft for Vote dis: "DIS", # Draft International Standard fdis: "FDIS", # Final Draft International Standard pdam: "PDAM", # Proposed Draft Amendment dam: "DAM", # Draft Amendment fdamd: "FDAM", # Final Draft Amendment (note: stage_code is fdamd) dcor: "DCOR", # Draft Corrigendum fdcor: "FDCOR", # Final Draft Corrigendum cdts: "CDTS", # Committee Draft Technical Specification dts: "DTS", # Draft Technical Specification fdts: "FDTS", # Final Draft Technical Specification }.freeze
- TYPE_CODE_MAP =
Document type mapping for RFC 5141-bis extended types
{ dir: "dir", # Directive dir_sup: "dir-sup", # Directive Supplement iwa_sup: "iwa-sup", # IWA Supplement }.freeze
Instance Attribute Summary collapse
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
Instance Method Summary collapse
-
#generate ⇒ String
Generate complete URN string.
-
#initialize(identifier) ⇒ UrnGenerator
constructor
Initialize URN generator.
Constructor Details
#initialize(identifier) ⇒ UrnGenerator
Initialize URN generator
46 47 48 |
# File 'lib/pubid/iso/urn_generator.rb', line 46 def initialize(identifier) @identifier = identifier end |
Instance Attribute Details
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
41 42 43 |
# File 'lib/pubid/iso/urn_generator.rb', line 41 def identifier @identifier end |
Instance Method Details
#generate ⇒ String
Generate complete URN string
53 54 55 56 57 58 59 |
# File 'lib/pubid/iso/urn_generator.rb', line 53 def generate if identifier.is_a?(SupplementIdentifier) generate_supplement_urn else generate_base_urn end end |