Class: Pubid::Ccsds::Identifiers::Base
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Pubid::Ccsds::Identifiers::Base
- Includes:
- Serializable
- Defined in:
- lib/pubid/ccsds/identifiers/base.rb,
lib/pubid/ccsds/identifiers/base_BASE_88929.rb
Overview
CCSDS identifier Format: CCSDS NUMBER.PART-TYPE-EDITION Example: CCSDS 120.0-G-4, CCSDS 100.0-G-1-S
Direct Known Subclasses
Constant Summary collapse
- TYPED_STAGES =
CCSDS uses a simple architecture without typed stages TYPED_STAGES includes default stage for base identifiers
[ Pubid::Components::TypedStage.new( abbr: [""], stage_code: "published", type_code: "base", ), ].freeze
Class Method Summary collapse
-
.type ⇒ Hash
Type information for this identifier class.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#base_hash ⇒ Object
Include CCSDS-specific attributes in serialization.
- #publisher ⇒ Object
- #to_s ⇒ Object
-
#to_urn ⇒ String
Generate URN for this identifier.
Class Method Details
.type ⇒ Hash
Type information for this identifier class
23 24 25 |
# File 'lib/pubid/ccsds/identifiers/base.rb', line 23 def self.type { key: :base, title: "Base Standard", short: nil } end |
Instance Method Details
#==(other) ⇒ Object
65 66 67 68 69 70 71 72 73 74 |
# File 'lib/pubid/ccsds/identifiers/base.rb', line 65 def ==(other) return false unless other.is_a?(Base) number == other.number && part == other.part && type == other.type && edition == other.edition && suffix == other.suffix && language == other.language end |
#base_hash ⇒ Object
Include CCSDS-specific attributes in serialization
32 33 34 35 36 37 38 39 |
# File 'lib/pubid/ccsds/identifiers/base.rb', line 32 def base_hash hash = super # CCSDS uses plain strings for type, edition, suffix hash[:type] = type if type hash[:suffix] = suffix if suffix hash[:language] = language if language hash end |
#publisher ⇒ Object
48 49 50 |
# File 'lib/pubid/ccsds/identifiers/base.rb', line 48 def publisher "CCSDS" end |
#to_s ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/pubid/ccsds/identifiers/base.rb', line 52 def to_s result = "#{publisher} #{number}" result += ".#{part}" if part result += "-#{type}" if type result += "-#{edition}" if edition result += "-#{suffix}" if suffix # Add language metadata result += " - #{language} Translated" if language result end |
#to_urn ⇒ String
Generate URN for this identifier
19 20 21 |
# File 'lib/pubid/ccsds/identifiers/base_BASE_88929.rb', line 19 def to_urn UrnGenerator.new(self).generate end |