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

parse, #publisher

Methods inherited from Identifier

apply_mappings, #base, #base_document, concrete_class_for, #dated_version_of?, #draft_of?, #drop_supplements, #edition_of?, #eql?, #exclude, from_hash, #has_supplement?, #hash, #includes?, #initialize, #matches?, #mr_all_parts, #mr_edition, #mr_languages, #mr_number, #mr_number_with_part, #mr_part, #mr_publisher, #mr_subpart, #mr_supplement_suffix, #mr_type, #mr_year, #new_edition_of?, polymorphic_name, polymorphic_type_map, #related_to?, #render, #resolve_urn_generator, #root, #sibling_of?, #supplement_of?, #to_hash, #to_mr_string, #to_slug, #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 == other.base && 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.to_s
  "#{base_str} Cor. #{number}"
end