Class: Pubid::Cie::Identifiers::Identical
- Inherits:
-
SingleIdentifier
- Object
- Lutaml::Model::Serializable
- Identifier
- Pubid::Cie::Identifier
- SingleIdentifier
- Pubid::Cie::Identifiers::Identical
- Includes:
- CodeAttributes
- Defined in:
- lib/pubid/cie/identifiers/identical.rb
Overview
Identical identifier for CIE Represents CIE identifiers with ISO reference Examples:
CIE S 006.1/1998 (ISO 16508:1999) - iteration with dot
CIE S 014-4/E2007 - part with dash + language
CIE S 008/E:2001 (ISO 8995-1:2002(E)) - language with colon year
Instance Method Summary collapse
Methods included from CodeAttributes
Methods inherited from SingleIdentifier
#date_sep_char, #exclude, #mr_languages, #mr_year
Methods inherited from Pubid::Cie::Identifier
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
Instance Method Details
#to_s ⇒ Object
21 22 23 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 53 54 55 56 57 58 59 60 |
# File 'lib/pubid/cie/identifiers/identical.rb', line 21 def to_s parts = ["CIE"] # S prefix parts << "S" if s_prefix # Code parts << code_string if number result = parts.join(" ") # Language + Year combined for slash formats before ISO reference if language && (language.format == "slash_colon" || (language.format == "slash" && year && style != "slash")) # Render /E:YYYY or /EYYYY (language with year, no separate date separator) result += if language.format == "slash_colon" "/#{language.code}:#{year}" # /E:2001 else "/#{language.code}#{year}" # /E2007 (no colon) end elsif language && language.format == "slash" # Language without year: /E result += "/#{language.code}" elsif year && style == "slash" # Legacy slash-year format without language: /1998 result += "/#{year}" elsif year # Standard date with separator derived from style result += "#{date_sep_char}#{year}" end # Language (parenthetical) after date if language && language.format != "slash" && language.format != "slash_colon" result += language.to_s end # ISO reference in parentheses result += " (ISO #{iso_reference})" if iso_reference result end |