Class: Pubid::Iso::Identifier::InternationalStandard

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

Constant Summary collapse

TYPED_STAGES =
{
  dp: {
    abbr: "DP",
    name: "Draft Proposal",
    harmonized_stages: %w[],
  },
  dis: {
    abbr: "DIS",
    name: "Draft International Standard",
    harmonized_stages: %w[40.00 40.20 40.60 40.92 40.93 40.98 40.99],
  },
  fdis: {
    abbr: "FDIS",
    name: "Final Draft International Standard",
    harmonized_stages: %w[50.00 50.20 50.60 50.92 50.98 50.99],
  },
}.freeze

Instance Attribute Summary

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

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

Constructor Details

#initialize(stage: nil, iteration: nil, **opts) ⇒ InternationalStandard

Returns a new instance of InternationalStandard.



24
25
26
27
28
29
30
31
# File 'lib/pubid/iso/identifier/international_standard.rb', line 24

def initialize(stage: nil, iteration: nil, **opts)

  if iteration && stage.nil?
    raise Errors::IsStageIterationError, "IS stage document cannot have iteration"
  end

  super
end

Class Method Details

.typeObject



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

def self.type
  { key: :is, title: "International Standard", short: nil }
end

Instance Method Details

#typed_stage_abbrevObject



33
34
35
36
37
38
39
# File 'lib/pubid/iso/identifier/international_standard.rb', line 33

def typed_stage_abbrev
  if self.class::TYPED_STAGES.key?(stage)
    super
  else
    stage&.abbr
  end
end