relaton/relaton-gb

View on GitHub
lib/relaton_gb/document_type.rb

Summary

Maintainability
A
0 mins
Test Coverage
module RelatonGb
  class DocumentType < RelatonBib::DocumentType
    DOCTYPES = %w[standard reccomendation].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