Class: Pubid::Cie::Identifiers::Corrigendum

Inherits:
SupplementIdentifier show all
Defined in:
lib/pubid/cie/identifiers/corrigendum.rb

Overview

Corrigendum identifier for CIE Handles /CorN notation with recursive base parsing Examples: CIE 232:2019/Cor1:2020, CIE 198-SP1.4:2011/Cor1:2013

Instance Method Summary collapse

Methods inherited from Pubid::Cie::Identifier

parse

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_supplement_s, #to_urn, #urn_supplement_type, #urn_type_code, #year

Constructor Details

This class inherits a constructor from Pubid::Identifier

Instance Method Details

#to_sObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/pubid/cie/identifiers/corrigendum.rb', line 19

def to_s
  # Build base identifier string
  result = "CIE #{base_number}"

  # Add supplement notation if base is a supplement
  if base_supplement
    result += "-SP#{base_supplement}"
    result += ".#{base_supplement_part}" if base_supplement_part
  end

  # Add base year with colon
  result += ":#{base_year}" if base_year

  # Add corrigendum with slash and colon
  result += "/Cor#{cor_number}:#{cor_year}"

  result
end