Class: Pubid::Amca::Identifiers::Publication

Inherits:
Pubid::Amca::Identifier show all
Defined in:
lib/pubid/amca/identifiers/publication.rb

Overview

Publication identifier for ACMA publications Examples:

  • AMCA Publication 211-22 (Rev. 01-23)
  • AMCA Publication 311-16
  • AMCA Publication 1011-03 (R2010)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Pubid::Amca::Identifier

#code_from_kv, #code_to_kv, parse, #to_urn, #year_from_kv, #year_to_kv

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?, #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_s, #to_slug, #to_supplement_s, #to_urn, #urn_supplement_type, #urn_type_code, #year

Constructor Details

#initialize(code:, year:, copublisher: nil, suffix: nil, reaffirmed: nil, revision: nil) ⇒ Publication

Returns a new instance of Publication.



14
15
16
17
18
19
20
21
22
# File 'lib/pubid/amca/identifiers/publication.rb', line 14

def initialize(code:, year:, copublisher: nil, suffix: nil,
reaffirmed: nil, revision: nil)
  @code = Components::Code.new(value: code.to_s)
  @year = Components::Date.new(year: year.to_s) if year
  @copublisher = copublisher
  @suffix = suffix
  @reaffirmed = reaffirmed
  @revision = revision
end

Instance Attribute Details

#revisionObject (readonly)

Returns the value of attribute revision.



12
13
14
# File 'lib/pubid/amca/identifiers/publication.rb', line 12

def revision
  @revision
end

Class Method Details

.typeObject



24
25
26
# File 'lib/pubid/amca/identifiers/publication.rb', line 24

def self.type
  { key: :publication, title: "Publication", short: nil }
end