Class: Pubid::Api::UrnGenerator
- Inherits:
-
UrnGenerator::Base
- Object
- UrnGenerator::Base
- Pubid::Api::UrnGenerator
- Defined in:
- lib/pubid/api/urn_generator.rb
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_year
Constructor Details
This class inherits a constructor from Pubid::UrnGenerator::Base
Instance Method Details
#generate ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/pubid/api/urn_generator.rb', line 10 def generate parts = ["urn", "api"] parts << urn_type parts << urn_number if urn_number parts << urn_part if urn_part parts << urn_year if urn_year parts[1] = identifier.publisher.to_s.downcase if identifier.publisher parts.join(":") end |
#urn_type ⇒ Object
6 7 8 |
# File 'lib/pubid/api/urn_generator.rb', line 6 def urn_type "std" end |