Class: Pubid::Cie::Identifiers::DualPublished

Inherits:
SingleIdentifier show all
Defined in:
lib/pubid/cie/identifiers/dual_published.rb

Overview

Dual published identifier for CIE Represents CIE/IEC dual published standards Example: CIE S 009:2002/IEC 62471:2006

Instance Method Summary collapse

Methods inherited from SingleIdentifier

#publisher

Methods inherited from Pubid::Cie::Identifier

parse

Instance Method Details

#to_sObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/pubid/cie/identifiers/dual_published.rb', line 16

def to_s
  parts = ["CIE"]

  # S prefix
  parts << "S" if s_prefix

  # Code
  parts << code.to_s if code

  result = parts.join(" ")

  # Date
  if year
    separator = date_separator == "colon" ? ":" : "-"
    result += "#{separator}#{year}"
  end

  # IEC portion with slash separator
  result += "/IEC #{iec_identifier}" if iec_identifier

  result
end