Class: Pubid::Iana::UrnGenerator
- Inherits:
-
UrnGenerator::Base
- Object
- UrnGenerator::Base
- Pubid::Iana::UrnGenerator
- Defined in:
- lib/pubid/iana/urn_generator.rb
Overview
Emits urn:iana:<registry>[:<sub_registry>]. Slugs contain no ":"
(charset is [a-zA-Z0-9._-]), so the two levels split unambiguously.
Instance Attribute Summary
Attributes inherited from UrnGenerator::Base
Instance Method Summary collapse
Methods inherited from UrnGenerator::Base
#initialize, #maybe, #urn_edition, #urn_language, #urn_namespace, #urn_number, #urn_part, #urn_publisher, #urn_subpart, #urn_type, #urn_year
Constructor Details
This class inherits a constructor from Pubid::UrnGenerator::Base
Instance Method Details
#generate ⇒ Object
8 9 10 11 12 |
# File 'lib/pubid/iana/urn_generator.rb', line 8 def generate parts = ["urn", "iana", identifier.registry] parts << identifier.sub_registry if identifier.sub_registry parts.join(":") end |