Class: Pubid::Ieee::Identifiers::ProjectDraftIdentifier
- Inherits:
-
Base
- Object
- Lutaml::Model::Serializable
- Pubid::Identifier
- Base
- 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
Instance Attribute Summary
Attributes inherited from Base
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.
Methods inherited from Base
#code, #draft, #draft_month, parse, parse_single, #publisher, #to_s
Methods inherited from Pubid::Identifier
#base_identifier, #eql?, #exclude, #hash, #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, #year
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 |