Class: RelatonIeee::DocumentType

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

Constant Summary collapse

DOCTYPES =
%w[guide recommended-practice standard witepaper redline other].freeze

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of DocumentType.



5
6
7
8
# File 'lib/relaton_ieee/document_type.rb', line 5

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

Instance Method Details

#check_type(type) ⇒ Object



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

def check_type(type)
  unless DOCTYPES.include? type
    Util.warn "Invalid doctype: `#{type}`. It should be one of: `#{DOCTYPES.join('`, `')}`."
  end
end