Class: Pubid::Ieee::Identifiers::ProjectDraftIdentifier
- Defined in:
- lib/pubid/ieee/identifiers/project_draft_identifier.rb
Overview
Project Draft Identifier Format: "IEEE P1234/D5, July 2019" where P1234 is the project number and D5 is the draft version This is distinct from a StandardIdentifier - the "P" indicates project status, not a code prefix like "C" in "C57.12"
Constant Summary collapse
- TYPED_STAGES =
[ Components::TypedStage.new( abbr: ["P"], stage_code: "draft", type_code: "draft", ieee_draft_equivalent: "P", approval_status: "unapproved", project_status: true, ), ].freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(**args) ⇒ ProjectDraftIdentifier
constructor
Override initialize to strip "P" prefix from code before creating Code object The "P" is reflected in the typed_stage, not in the Code component itself.
Constructor Details
#initialize(**args) ⇒ ProjectDraftIdentifier
Override initialize to strip "P" prefix from code before creating Code object The "P" is reflected in the typed_stage, not in the Code component itself
29 30 31 32 33 34 35 36 37 |
# File 'lib/pubid/ieee/identifiers/project_draft_identifier.rb', line 29 def initialize(**args) # If code is provided with "P" prefix (e.g., "P1234"), strip it if args[:code].is_a?(String) && args[:code].start_with?("P") args[:code] = args[:code][1..] # Strip leading "P" end # Call parent initialize with modified code super end |
Class Method Details
.type ⇒ Object
23 24 25 |
# File 'lib/pubid/ieee/identifiers/project_draft_identifier.rb', line 23 def self.type { key: :P, title: "Project Draft", short: "P" } end |