Class: RelatonItu::DocumentType

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

Constant Summary collapse

TYPES =
%w[
  recommendation recommendation-supplement recommendation-amendment
  recommendation-corrigendum recommendation-errata recommendation-annex
  focus-group implementers-guide technical-paper technical-report
  joint-itu-iso-iec resolution service-publication handbook question
].freeze

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of DocumentType.



10
11
12
13
# File 'lib/relaton_itu/document_type.rb', line 10

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

Instance Method Details

#check_type(type) ⇒ Object



15
16
17
18
19
# File 'lib/relaton_itu/document_type.rb', line 15

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