relaton/relaton-itu

View on GitHub
lib/relaton_itu/document_type.rb

Summary

Maintainability
A
0 mins
Test Coverage
module RelatonItu
  class DocumentType < RelatonBib::DocumentType
    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

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

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