Class: Pubid::Amca::Identifiers::Base
- Inherits:
-
Identifier
- Object
- Lutaml::Model::Serializable
- Identifier
- Pubid::Amca::Identifiers::Base
- Defined in:
- lib/pubid/amca/identifiers/base.rb
Overview
Base identifier class for ACMA identifiers Single Responsibility: Common functionality for all ACMA identifier types
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#base_hash ⇒ Object
Override base_hash to handle AMCA-specific copublisher format (string, not array).
-
#publisher ⇒ Object
AMCA uses a fixed publisher string.
- #to_urn ⇒ Object
Methods inherited from Identifier
#base_identifier, #eql?, #exclude, #hash, #initialize, #mr_number, #mr_number_with_part, #mr_part, #mr_publisher, #mr_type, #mr_year, #new_edition_of?, polymorphic_name, #render, #resolve_urn_generator, #root, #to_mr_string, #to_s, #to_supplement_s, #urn_supplement_type, #urn_type_code, #year
Constructor Details
This class inherits a constructor from Pubid::Identifier
Class Method Details
.parse(string) ⇒ Object
28 29 30 |
# File 'lib/pubid/amca/identifiers/base.rb', line 28 def self.parse(string) Amca::Identifier.parse(string) end |
Instance Method Details
#base_hash ⇒ Object
Override base_hash to handle AMCA-specific copublisher format (string, not array)
10 11 12 13 14 15 |
# File 'lib/pubid/amca/identifiers/base.rb', line 10 def base_hash hash = super # AMCA's copublisher is a string, not an array, so remove it from copublishers hash.delete(:copublishers) if hash[:copublishers] hash end |
#publisher ⇒ Object
AMCA uses a fixed publisher string
24 25 26 |
# File 'lib/pubid/amca/identifiers/base.rb', line 24 def publisher "AMCA" end |
#to_urn ⇒ Object
32 33 34 |
# File 'lib/pubid/amca/identifiers/base.rb', line 32 def to_urn UrnGenerator.new(self).generate end |