Class: Pubid::Ieee::Identifiers::CsaDualPublished

Inherits:
Base show all
Defined in:
lib/pubid/ieee/identifiers/csa_dual_published.rb

Overview

CSA dual published identifier Represents IEEE/CSA dual published standards Example: IEEE Std 844.1-2017/CSA C22.2 No. 293.1-17

Instance Attribute Summary collapse

Attributes inherited from Base

#code_obj, #draft_obj

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#draft, #draft_month, #initialize, parse_single

Methods inherited from Pubid::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::Ieee::Identifiers::Base

Instance Attribute Details

#csa_identifierObject

CSA identifier is stored as-is (not a Lutaml model type)



12
13
14
# File 'lib/pubid/ieee/identifiers/csa_dual_published.rb', line 12

def csa_identifier
  @csa_identifier
end

Class Method Details

.parse(string) ⇒ Object



45
46
47
# File 'lib/pubid/ieee/identifiers/csa_dual_published.rb', line 45

def self.parse(string)
  Base.parse(string)
end

Instance Method Details

#codeObject



23
24
25
# File 'lib/pubid/ieee/identifiers/csa_dual_published.rb', line 23

def code
  ieee_identifier.code
end

#copublisherObject



19
20
21
# File 'lib/pubid/ieee/identifiers/csa_dual_published.rb', line 19

def copublisher
  ieee_identifier.copublisher
end

#publisherObject

Delegate common attributes to ieee_identifier



15
16
17
# File 'lib/pubid/ieee/identifiers/csa_dual_published.rb', line 15

def publisher
  ieee_identifier.publisher
end

#to_sObject



35
36
37
38
39
40
41
42
43
# File 'lib/pubid/ieee/identifiers/csa_dual_published.rb', line 35

def to_s
  # Format: IEEE_IDENTIFIER/CSA CSA_IDENTIFIER
  # The CSA identifier should render with "CSA" prefix
  csa_str = csa_identifier.to_s
  # Ensure CSA prefix is present
  csa_str = "CSA #{csa_str}" unless csa_str.start_with?("CSA", "CAN/")

  "#{ieee_identifier}/#{csa_str}"
end

#typed_stageObject



31
32
33
# File 'lib/pubid/ieee/identifiers/csa_dual_published.rb', line 31

def typed_stage
  ieee_identifier.typed_stage
end

#yearObject



27
28
29
# File 'lib/pubid/ieee/identifiers/csa_dual_published.rb', line 27

def year
  ieee_identifier.year
end