Class: Pubid::Nist::Identifiers::CommercialStandardEmergency

Inherits:
Base
  • Object
show all
Defined in:
lib/pubid/nist/identifiers/commercial_standard_emergency.rb

Overview

NBS Commercial Standard (Emergency) Identifier Format: NBS CS eNNN-YY where NNN is edition number, YY is 2-digit year Example: “NBS CS e104-43” = Commercial Standard Emergency edition 104, year 1943

Constant Summary collapse

TYPED_STAGES =
[
  Pubid::Components::TypedStage.new(
    abbr: ["CS-E", "NBS CS-E"],
    stage_code: "published",
    type_code: "cse",
  ),
].freeze

Constants inherited from Base

Base::EQUALITY_IGNORED_ATTRS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#==, #append_mr_components, #append_short_components, #default_publisher, #edition_greater?, #exclude, #extract_edition_number, #hash, #initialize, #language, #matches?, #merge, #publisher_abbreviated_name, #publisher_full_name, #render, #revision, #series_abbreviated_name, #series_full_name, #supplement_short, #to_abbreviated_style, #to_full_style, #to_mr_style, #to_s, #translation, #weight

Methods included from Pubid::Nist::Identifier

parse

Methods included from IdentifierFacade

#from_hash, #polymorphic_type_map

Methods inherited from 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, #year

Constructor Details

This class inherits a constructor from Pubid::Nist::Identifiers::Base

Class Method Details

.typeObject



23
24
25
26
27
# File 'lib/pubid/nist/identifiers/commercial_standard_emergency.rb', line 23

def type
  { key: :cse,
  web: :commercial_standard_emergency, title: "NBS Commercial Standard Emergency",
    short: "CS-E" }
end

.typed_stagesObject



19
20
21
# File 'lib/pubid/nist/identifiers/commercial_standard_emergency.rb', line 19

def typed_stages
  TYPED_STAGES
end

Instance Method Details

#series_codeObject



30
31
32
# File 'lib/pubid/nist/identifiers/commercial_standard_emergency.rb', line 30

def series_code
  "CS-E"
end

#to_short_styleObject



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/pubid/nist/identifiers/commercial_standard_emergency.rb', line 36

def to_short_style
  result = ""

  # Publisher
  effective_publisher = publisher ? publisher.to_s : "NBS"
  result += effective_publisher

  # Series as CS-E
  result += " CS-E"

  # Number (already extracted from e104 → 104 in builder)
  result += " #{number.value}" if number

  # Edition (e1943 for e104-43 pattern) plus any other component the
  # parser attached (volume, supplement, version, ...).
  result += append_short_components

  result
end