relaton/relaton-iec

View on GitHub
lib/relaton_iec/document_type.rb

Summary

Maintainability
A
0 mins
Test Coverage
module RelatonIec
  class DocumentType < RelatonBib::DocumentType
    DOCTYPES = %w[
      international-standard technical-specification technical-report
      publicly-available-specification international-workshop-agreement
      guide industry-technical-agreement system-reference-deliverable
    ].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