Class: Pubid::Ccsds::Identifiers::Corrigendum

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

Constant Summary collapse

TYPED_STAGES =

CCSDS Corrigendum typed stage

[
  Pubid::Components::TypedStage.new(
    abbr: ["Cor", "Corr"],
    stage_code: "published",
    type_code: "cor",
  ),
].freeze

Constants inherited from Pubid::Ccsds::Identifier

Pubid::Ccsds::Identifier::CCSDS_TYPE_MAP

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SupplementIdentifier

#<=>

Methods inherited from Pubid::Ccsds::Identifier

from_hash, parse, #publisher

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

Class Method Details

.typeHash

Type information for this identifier class

Returns:

  • (Hash)

    Type information with key, title, and short form



19
20
21
22
# File 'lib/pubid/ccsds/identifiers/corrigendum.rb', line 19

def self.type
  { key: :cor,
    web: :corrigendum, title: "Corrigendum", short: "Cor" }
end

Instance Method Details

#==(other) ⇒ Object



32
33
34
35
36
# File 'lib/pubid/ccsds/identifiers/corrigendum.rb', line 32

def ==(other)
  return false unless other.is_a?(Corrigendum)

  base_identifier == other.base_identifier && number == other.number
end

#to_sObject

The corrigendum sequence number is stored in the inherited ‘number` attribute (mirroring ISO), so it serializes via Base’s key_value as { _type, number: ‘1’, base: … } with no corrigendum-specific map.



27
28
29
30
# File 'lib/pubid/ccsds/identifiers/corrigendum.rb', line 27

def to_s
  base_str = base_identifier.to_s
  "#{base_str} Cor. #{number}"
end