Class: Pubid::Nist::Identifiers::MiscellaneousPublication
- Inherits:
-
Base
- Object
- Lutaml::Model::Serializable
- Identifier
- Base
- Pubid::Nist::Identifiers::MiscellaneousPublication
- 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
Constants inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
- #default_publisher ⇒ Object
- #series_code ⇒ Object
- #to_mr_style ⇒ Object
- #to_s(format = :short) ⇒ Object
- #to_short_style ⇒ Object
Methods inherited from Base
#==, #append_mr_components, #append_short_components, #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, #translation, #weight
Methods included from Pubid::Nist::Identifier
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_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
.type ⇒ Object
25 26 27 28 |
# File 'lib/pubid/nist/identifiers/miscellaneous_publication.rb', line 25 def type { key: :mp, web: :miscellaneous_publication, title: "Miscellaneous Publication", short: "MP" } end |
.typed_stages ⇒ Object
21 22 23 |
# File 'lib/pubid/nist/identifiers/miscellaneous_publication.rb', line 21 def typed_stages TYPED_STAGES end |
Instance Method Details
#default_publisher ⇒ Object
31 32 33 |
# File 'lib/pubid/nist/identifiers/miscellaneous_publication.rb', line 31 def default_publisher "NBS" end |
#series_code ⇒ Object
35 36 37 |
# File 'lib/pubid/nist/identifiers/miscellaneous_publication.rb', line 35 def series_code "MP" end |
#to_mr_style ⇒ Object
57 58 59 60 61 62 |
# File 'lib/pubid/nist/identifiers/miscellaneous_publication.rb', line 57 def to_mr_style result = "#{default_publisher}.#{series_code}" result += ".#{number.value}" if number result += append_mr_components result end |
#to_s(format = :short) ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'lib/pubid/nist/identifiers/miscellaneous_publication.rb', line 39 def to_s(format = :short) case format when :mr to_mr_style else to_short_style end end |
#to_short_style ⇒ Object
50 51 52 53 54 55 |
# File 'lib/pubid/nist/identifiers/miscellaneous_publication.rb', line 50 def to_short_style result = "#{default_publisher} #{series_code}" result += " #{number.value}" if number result += append_short_components result end |