Class: Pubid::Nist::Identifiers::MiscellaneousPublication

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

Overview

NBS MP (Miscellaneous Publication) Identifier Examples:

  • “NBS MP 39e1” - Edition with “e” notation

  • “NBS MP 260e1965” - Edition with year as edition ID

NOTE: Parenthetical edition format (e.g., “39(1)”) does NOT exist for MP identifiers

Constant Summary collapse

TYPED_STAGES =
[
  Pubid::Components::TypedStage.new(
    abbr: ["MP", "NBS MP"],
    stage_code: "published",
    type_code: "mp",
  ),
].freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#edition_greater?, #extract_edition_number, #initialize, #language, #merge, #publisher, #revision, #translation, #weight

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_supplement_s, #to_urn, #urn_supplement_type, #urn_type_code

Constructor Details

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

Class Method Details

.typeObject



25
26
27
# File 'lib/pubid/nist/identifiers/miscellaneous_publication.rb', line 25

def type
  { key: :mp, title: "Miscellaneous Publication", short: "MP" }
end

.typed_stagesObject



21
22
23
# File 'lib/pubid/nist/identifiers/miscellaneous_publication.rb', line 21

def typed_stages
  TYPED_STAGES
end

Instance Method Details

#default_publisherObject



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

def default_publisher
  "NBS"
end

#series_codeObject



34
35
36
# File 'lib/pubid/nist/identifiers/miscellaneous_publication.rb', line 34

def series_code
  "MP"
end

#to_s(format = :short) ⇒ Object



38
39
40
41
42
43
44
45
# File 'lib/pubid/nist/identifiers/miscellaneous_publication.rb', line 38

def to_s(format = :short)
  case format
  when :mr
    to_mr_style
  else
    to_short_style
  end
end