Class: Pubid::Iec::Identifiers::TechnicalSpecification
- Inherits:
-
Base
- Object
- Lutaml::Model::Serializable
- Pubid::Identifier
- Pubid::Iec::Identifier
- SingleIdentifier
- Base
- Pubid::Iec::Identifiers::TechnicalSpecification
- Defined in:
- lib/pubid/iec/identifiers/technical_specification.rb
Overview
Technical Specification identifier class Single Responsibility: Represents IEC Technical Specification documents
Constant Summary collapse
- TYPED_STAGES =
Convert v1 hash-based TYPED_STAGES to v2 object-based From gems/pubid-iec/lib/pubid/iec/identifier/technical_specification.rb
[ Pubid::Components::TypedStage.new( code: :pwi_ts, stage_code: :pwi, type_code: :ts, abbr: ["PWI TS"], name: "Preliminary Work Item Technical Specification", harmonized_stages: %w[00.00 00.20 00.60 00.98 00.99], ), Pubid::Components::TypedStage.new( code: :np_ts, stage_code: :np, type_code: :ts, abbr: ["NP TS"], name: "New Proposal Technical Specification", harmonized_stages: %w[10.00 10.20 10.60 10.92 10.98], ), Pubid::Components::TypedStage.new( code: :anw_ts, stage_code: :anw, type_code: :ts, abbr: ["ANW TS"], name: "Approved New Work Item Technical Specification", harmonized_stages: %w[10.99 20.00], ), Pubid::Components::TypedStage.new( code: :wd_ts, stage_code: :wd, type_code: :ts, abbr: ["WD TS"], name: "Working Draft Technical Specification", harmonized_stages: %w[20.20 20.60 20.98 20.99], ), Pubid::Components::TypedStage.new( code: :cd_ts, stage_code: :cd, type_code: :ts, abbr: ["CD TS"], name: "Committee Draft Technical Specification", harmonized_stages: %w[30.00 30.20 30.60 30.92 30.98 30.99], ), Pubid::Components::TypedStage.new( code: :dts, stage_code: :draft, type_code: :ts, abbr: ["DTS"], name: "Draft Technical Specification", harmonized_stages: %w[50.00 50.20 50.60 50.92 50.98 50.99], ), Pubid::Components::TypedStage.new( code: :ts, stage_code: :published, type_code: :ts, abbr: ["TS"], name: "Technical Specification", harmonized_stages: %w[60.00 60.60 90.20 90.60 90.92 90.93 90.99 95.20 95.60 95.92 95.99], ), ].freeze
- PROJECT_STAGES =
Project stages specific to Technical Specifications These are IEC-specific workflow stages
{ adts: { abbr: "ADTS", name: "Approved for DTS", harmonized_stages: %w[40.99], }, cdts: { abbr: "CDTS", name: "Draft circulated as DTS", harmonized_stages: %w[50.20], }, dtsm: { abbr: "DTSM", name: "Rejected DTS to be discussed at meeting", harmonized_stages: %w[50.92], }, ndts: { abbr: "NDTS", name: "DTS rejected", harmonized_stages: %w[50.92], }, prvdts: { abbr: "PRVDTS", name: "Preparation of RVDTS", harmonized_stages: %w[50.60], }, tdts: { abbr: "TDTS", name: "Translation of DTS", harmonized_stages: %w[50.00], }, }.freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#publisher_portion ⇒ Object
Override publisher_portion to handle TS formatting If copublishers exist, use parent implementation.
Methods inherited from Base
#number_portion, #to_s, #validate!
Methods inherited from SingleIdentifier
#edition_portion, #language_portion, #number_portion, #to_s
Methods inherited from Pubid::Iec::Identifier
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_s, #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
108 109 110 |
# File 'lib/pubid/iec/identifiers/technical_specification.rb', line 108 def self.type { key: :ts, title: "Technical Specification", short: "TS" } end |
Instance Method Details
#publisher_portion ⇒ Object
Override publisher_portion to handle TS formatting If copublishers exist, use parent implementation
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/pubid/iec/identifiers/technical_specification.rb', line 114 def publisher_portion # If copublishers, delegate to parent (SingleIdentifier) which handles them return super if copublishers&.any? # No copublishers: simple TS formatting result = publisher.to_s if typed_stage abbr = typed_stage.abbreviation # TS uses space for all stages result += " #{abbr}" unless abbr.empty? end result end |