Class: Pubid::Ccsds::SupplementIdentifier

Inherits:
Identifier show all
Defined in:
lib/pubid/ccsds/supplement_identifier.rb

Overview

Base class for CCSDS supplements (corrigenda, amendments, etc.). Descends from the abstract root (not the concrete Base) and points ‘base_identifier` at the root, so the polymorphic attribute never resolves to its own superclass — which is what prevents lutaml from recursing forever while building a supplement from a hash.

Direct Known Subclasses

Identifiers::Corrigendum

Constant Summary

Constants inherited from Identifier

Identifier::CCSDS_TYPE_MAP

Instance Method Summary collapse

Methods inherited from 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_s, #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

#<=>(other) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/pubid/ccsds/supplement_identifier.rb', line 23

def <=>(other)
  return nil unless other.is_a?(SupplementIdentifier)

  # Compare base identifiers first
  if base_identifier && other.base_identifier
    base_cmp = base_identifier <=> other.base_identifier
    return base_cmp unless base_cmp.zero?
  end

  # Subclasses should implement more specific comparison
  0
end