Class: Pubid::Ogc::UrnGenerator

Inherits:
UrnGenerator::Base show all
Defined in:
lib/pubid/ogc/urn_generator.rb

Overview

Emits urn:ogc:<year>:<number>[:<revision>], e.g. urn:ogc:24:032:r1.

Instance Attribute Summary

Attributes inherited from UrnGenerator::Base

#identifier

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

#generateObject



7
8
9
10
11
# File 'lib/pubid/ogc/urn_generator.rb', line 7

def generate
  parts = ["urn", "ogc", identifier.year.to_s, identifier.number.to_s]
  parts << identifier.revision.to_s if identifier.revision
  parts.join(":")
end