Class: Pubid::Cie::Identifiers::JointPublished

Inherits:
SingleIdentifier show all
Includes:
CodeAttributes
Defined in:
lib/pubid/cie/identifiers/joint_published.rb

Overview

Joint published identifier for CIE Handles CIE ISO, CIE IEC, CIE ISO/CIE patterns

Instance Method Summary collapse

Methods included from CodeAttributes

#code_string, included

Methods inherited from SingleIdentifier

#date_sep_char, #exclude, #mr_languages, #mr_year

Methods inherited from Pubid::Cie::Identifier

parse

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_sObject



18
19
20
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
# File 'lib/pubid/cie/identifiers/joint_published.rb', line 18

def to_s
  parts = ["CIE", copublisher]

  # Document type (TR)
  parts << doc_type if doc_type

  # Stage (DIS)
  parts << stage if stage

  # Code (number-part) - special handling for IEC dot separator
  if number
    code_str = code_string
    # For IEC copublisher, if code has a part, use dot not slash/dash
    if copublisher == "IEC" && part
      code_str = "#{number}.#{part}"
    end
    parts << code_str
  end

  result = parts.join(" ")

  # Date - separator derived from style
  if year
    result += "#{date_sep_char}#{year}"
  end

  # Language (always parenthetical for joint published)
  result += language.to_s if language

  result
end