relaton/relaton-ietf

View on GitHub
lib/relaton_ietf/document_type.rb

Summary

Maintainability
A
0 mins
Test Coverage
module RelatonIetf
  class DocumentType < RelatonBib::DocumentType
    DOCTYPES = %w[rfc internet-draft].freeze

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

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