Class: Relaton3gpp::DocumentType

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

Constant Summary collapse

DOCTYPES =
%w[TS TR].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_3gpp/document_type.rb', line 5

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

Instance Method Details

#check(type) ⇒ Object

Parameters:

  • type (String)


11
12
13
14
15
16
# File 'lib/relaton_3gpp/document_type.rb', line 11

def check(type)
  unless DOCTYPES.include? type
    Util.warn "Unknown doctype: `#{type}`"
    Util.warn "Possible doctypes: `#{DOCTYPES.join '`, `'}`"
  end
end