Class: Pubid::Bsi::Identifiers::Disc
- Inherits:
-
SingleIdentifier
- Object
- Lutaml::Model::Serializable
- Identifier
- SingleIdentifier
- Pubid::Bsi::Identifiers::Disc
- Defined in:
- lib/pubid/bsi/identifiers/disc.rb
Overview
DISC (Delivering Information Solutions to Customers) identifier Examples: “DISC PD 2000-2:1997”, “DISC PD 3004:1998”
Constant Summary collapse
- TYPED_STAGES =
[ Pubid::Components::TypedStage.new( code: :disc, stage_code: :published, type_code: :disc, abbr: ["DISC"], name: "DISC", harmonized_stages: %w[60.00 60.60], ), ].freeze
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from SingleIdentifier
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
Constructor Details
This class inherits a constructor from Pubid::Identifier
Class Method Details
.type ⇒ Object
20 21 22 |
# File 'lib/pubid/bsi/identifiers/disc.rb', line 20 def self.type { key: :disc, title: "DISC", short: "DISC" } end |
Instance Method Details
#to_s(lang: :en, lang_single: false) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/pubid/bsi/identifiers/disc.rb', line 24 def to_s(lang: :en, lang_single: false) parts = [] # DISC prefix parts << "DISC" # Type (PD) + number if number number_str = if number.is_a?(Components::Code) number.value.to_s else number.to_s end if part part_val = part.is_a?(Components::Code) ? part.value : part number_str += "-#{part_val.to_s.strip}" end parts << "PD #{number_str}" end result = parts.join(" ") # Date with colon separator if date result += ":#{date}" end result end |