Class: Pubid::Nist::Identifiers::Monograph

Inherits:
Pubid::Nist::Identifier show all
Defined in:
lib/pubid/nist/identifiers/monograph.rb

Overview

NBS/NIST MONO (Monograph) Identifier Examples:

  • "NBS MONO 158" - Basic monograph
  • "NIST MONO 178" - NIST monograph
  • "NBS MONO 128pt1" - Monograph with part
  • "NIST MONO 1-1F" - Monograph with letter suffix
  • "NIST MONO 1-2Bv1" - Monograph with letter suffix and volume

Constant Summary collapse

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

Constants inherited from Pubid::Nist::Identifier

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

Methods inherited from Pubid::Nist::Identifier

#==, #append_mr_components, #append_short_components, #default_publisher, #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_short_style, #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

Constructor Details

This class inherits a constructor from Pubid::Nist::Identifier

Class Method Details

.typeObject



27
28
29
30
# File 'lib/pubid/nist/identifiers/monograph.rb', line 27

def type
  { key: :mono,
  web: :monograph, title: "Monograph", short: "MONO" }
end

.typed_stagesObject



23
24
25
# File 'lib/pubid/nist/identifiers/monograph.rb', line 23

def typed_stages
  TYPED_STAGES
end

Instance Method Details

#series_codeObject



33
34
35
# File 'lib/pubid/nist/identifiers/monograph.rb', line 33

def series_code
  "MONO"
end

#to_s(format = nil) ⇒ Object



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

def to_s(format = nil)
  # Handle both keyword argument (hash) and positional argument (symbol/string)
  effective_format = if format.is_a?(Hash)
                       format[:format]
                     else
                       format
                     end

  # If explicit format is specified, use it. Otherwise, default to short.
  if effective_format.nil?
    super(:short)
  elsif effective_format == :mr
    to_mr_style
  else
    super(effective_format)
  end
end