Class: Pubid::Iec::Identifiers::PubliclyAvailableSpecification

Inherits:
Base show all
Defined in:
lib/pubid/iec/identifiers/publicly_available_specification.rb

Overview

Publicly Available Specification identifier class Single Responsibility: Represents IEC PAS documents

Constant Summary collapse

TYPED_STAGES =

Convert v1 hash-based TYPED_STAGES to v2 object-based From gems/pubid-iec/lib/pubid/iec/identifier/publicly_available_specification.rb

[
  Pubid::Components::TypedStage.new(
    code: :pwi_pas,
    stage_code: :pwi,
    type_code: :pas,
    abbr: ["PWI PAS"],
    name: "Preliminary Work Item Publicly Available Specification",
    harmonized_stages: %w[00.00 00.20 00.60 00.98 00.99],
  ),
  Pubid::Components::TypedStage.new(
    code: :np_pas,
    stage_code: :np,
    type_code: :pas,
    abbr: ["NP PAS"],
    name: "New Proposal Publicly Available Specification",
    harmonized_stages: %w[10.00 10.20 10.60 10.92 10.98],
  ),
  Pubid::Components::TypedStage.new(
    code: :anw_pas,
    stage_code: :anw,
    type_code: :pas,
    abbr: ["ANW PAS"],
    name: "Approved New Work Item Publicly Available Specification",
    harmonized_stages: %w[10.99 20.00],
  ),
  Pubid::Components::TypedStage.new(
    code: :wd_pas,
    stage_code: :wd,
    type_code: :pas,
    abbr: ["WD PAS"],
    name: "Working Draft Publicly Available Specification",
    harmonized_stages: %w[20.20 20.60 20.98 20.99],
  ),
  Pubid::Components::TypedStage.new(
    code: :cdpas,
    stage_code: :cd,
    type_code: :pas,
    abbr: ["CDPAS"],
    name: "Committee Draft Publicly Available Specification",
    harmonized_stages: %w[30.00 30.20 30.60 30.92 30.98 30.99],
  ),
  Pubid::Components::TypedStage.new(
    code: :dpas,
    stage_code: :draft,
    type_code: :pas,
    abbr: ["DPAS"],
    name: "Draft Publicly Available Specification",
    harmonized_stages: %w[50.00 50.20 50.60 50.92 50.98 50.99],
  ),
  Pubid::Components::TypedStage.new(
    code: :pas,
    stage_code: :published,
    type_code: :pas,
    abbr: ["PAS"],
    name: "Publicly Available 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 PAS

{
  PRVDPAS: {
    abbr: "PRVDPAS",
    name: "Preparation of RVDPAS",
    harmonized_stages: %w[50.60],
  },
}.freeze

Class Method Summary collapse

Instance Method Summary collapse

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

parse

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

.typeObject



82
83
84
# File 'lib/pubid/iec/identifiers/publicly_available_specification.rb', line 82

def self.type
  { key: :pas, title: "Publicly Available Specification", short: "PAS" }
end

Instance Method Details

#publisher_portionObject

Override publisher_portion to add PAS or DPAS stage



87
88
89
90
91
92
93
94
95
96
97
# File 'lib/pubid/iec/identifiers/publicly_available_specification.rb', line 87

def publisher_portion
  result = publisher.to_s

  if typed_stage
    abbr = typed_stage.abbreviation
    # PAS uses space for all stages
    result += " #{abbr}" unless abbr.empty?
  end

  result
end