Class: Pubid::Nist::Identifiers::Monograph
- Inherits:
-
Base
- Object
- Lutaml::Model::Serializable
- Identifier
- Base
- Pubid::Nist::Identifiers::Monograph
- 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
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
.type ⇒ Object
27 28 29 |
# File 'lib/pubid/nist/identifiers/monograph.rb', line 27 def type { key: :mono, title: "Monograph", short: "MONO" } end |
.typed_stages ⇒ Object
23 24 25 |
# File 'lib/pubid/nist/identifiers/monograph.rb', line 23 def typed_stages TYPED_STAGES end |
Instance Method Details
#series_code ⇒ Object
32 33 34 |
# File 'lib/pubid/nist/identifiers/monograph.rb', line 32 def series_code "MONO" end |
#to_s(format = nil) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/pubid/nist/identifiers/monograph.rb', line 36 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 |