Class: Relaton::Plateau::DocumentType

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

Constant Summary collapse

DOCTYPES =
%w[handbook technical-report annex].freeze

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of DocumentType.



6
7
8
9
# File 'lib/relaton/plateau/document_type.rb', line 6

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

Instance Method Details

#check_type(type) ⇒ Object



11
12
13
14
15
# File 'lib/relaton/plateau/document_type.rb', line 11

def check_type(type)
  return if DOCTYPES.include? type

  Util.warn "invalid doctype: `#{type}`"
end