Class: Pubid::Nist::Identifiers::MiscellaneousPublication
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
Pubid::Nist::Identifier::COMPACT_DROP_ATTRS, Pubid::Nist::Identifier::COMPACT_FLAT_CODES, Pubid::Nist::Identifier::COMPACT_FLAT_VALUES, Pubid::Nist::Identifier::EQUALITY_IGNORED_ATTRS
Class Method Summary
collapse
Instance Method Summary
collapse
#==, #append_mr_components, #append_short_components, #edition_greater?, expand_code, expand_compact_hash, #extract_edition_number, from_hash, #hash, #initialize, #language, #matches?, #merge, parse, #publisher_abbreviated_name, #publisher_full_name, #render, #revision, #series_abbreviated_name, #series_full_name, #supplement_short, #to_abbreviated_style, #to_full_style, #to_hash, #to_mr_string, #to_slug, #translation, #weight
Methods inherited from Identifier
apply_mappings, #base, #base_document, concrete_class_for, #dated_version_of?, #draft_of?, #drop_supplements, #edition_of?, #eql?, #exclude, from_hash, #has_supplement?, #hash, #includes?, #initialize, #matches?, #mr_all_parts, #mr_edition, #mr_languages, #mr_number, #mr_number_with_part, #mr_part, #mr_publisher, #mr_subpart, #mr_supplement_suffix, #mr_type, #mr_year, #new_edition_of?, polymorphic_name, polymorphic_type_map, #related_to?, #render, #resolve_urn_generator, #root, #sibling_of?, #supplement_of?, #to_hash, #to_mr_string, #to_slug, #to_supplement_s, #to_urn, #urn_supplement_type, #urn_type_code, #year
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
|