Class: RelatonUn::DocumentType

Inherits:
RelatonBib::DocumentType
  • Object
show all
Defined in:
lib/relaton_un/document_type.rb

Constant Summary collapse

DOCTYPES =
%w[
  recommendation plenary addendum communication corrigendum reissue agenda
  budgetary sec-gen-notes expert-report resolution
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(type:, abbreviation: nil) ⇒ DocumentType

Returns a new instance of DocumentType.



8
9
10
11
# File 'lib/relaton_un/document_type.rb', line 8

def initialize(type:, abbreviation: nil)
  check_type type
  super
end

Instance Method Details

#check_type(type) ⇒ Object



13
14
15
16
17
# File 'lib/relaton_un/document_type.rb', line 13

def check_type(type)
  unless DOCTYPES.include? type
    Util.warn "invalid doctype: `#{type}`"
  end
end