Class: Pubid::Iso::Identifier::Supplement

Inherits:
Base
  • Object
show all
Defined in:
lib/pubid/iso/identifier/supplement.rb

Direct Known Subclasses

Addendum, Amendment, Corrigendum

Constant Summary collapse

TYPED_STAGES =
{
  dsuppl: {
    abbr: "DSuppl",
    name: "Draft Supplement",
    harmonized_stages: %w[40.00 40.20 40.60 40.92 40.93 40.98 40.99],
  },
  fdsuppl: {
    abbr: "FDIS Suppl",
    name: "Final Draft Supplement",
    harmonized_stages: %w[50.00 50.20 50.60 50.92 50.98 50.99],
  },
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Base

#addendum, #base, #dirtype, #iteration, #joint_document, #jtc_dir, #month, #scnumber, #sctype, #stage, #supplements, #tcnumber, #tctype, #wgnumber, #wgtype

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

create_supplements, get_amendment_class, get_corrigendum_class, get_identifier, get_parser_class, get_transformer_class, get_update_codes, #render_all_parts, #render_joint_document, #resolve_format, #root, supplement_by_type, supplements_has_type?, #to_s, transform, transform_supplements, type_match?

Constructor Details

#initialize(publisher: nil, separator: nil, **opts) ⇒ Supplement

Returns a new instance of Supplement.



24
25
26
27
# File 'lib/pubid/iso/identifier/supplement.rb', line 24

def initialize(publisher: nil, separator: nil, **opts)
  @separator = separator
  super(publisher: publisher, **opts)
end

Instance Attribute Details

#separatorObject

Returns the value of attribute separator.



22
23
24
# File 'lib/pubid/iso/identifier/supplement.rb', line 22

def separator
  @separator
end

Class Method Details

.get_renderer_classObject



37
38
39
# File 'lib/pubid/iso/identifier/supplement.rb', line 37

def self.get_renderer_class
  Renderer::Supplement
end

.typeObject



33
34
35
# File 'lib/pubid/iso/identifier/supplement.rb', line 33

def self.type
  { key: :sup, title: "Supplement", values: %w[Supplement Suppl SUP], short: "SUP" }
end

Instance Method Details

#base_has_edition?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/pubid/iso/identifier/supplement.rb', line 29

def base_has_edition?
  @base.base.nil? && !@base.edition.nil? || (!@base.base.nil? && !@base.base.edition.nil?)
end

#urnObject



41
42
43
# File 'lib/pubid/iso/identifier/supplement.rb', line 41

def urn
  Renderer::UrnSupplement.new(to_h(deep: false)).render
end