Class: RelatonBipm::DocumentType

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

Constant Summary collapse

DOCTYPES =
%w[brochure mise-en-pratique rapport monographie guide
meeting-report technical-report working-party-note strategy
cipm-mra resolutions].freeze

Instance Method Summary collapse

Constructor Details

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

Initialize a document type object.

Parameters:

  • type (String)

    document type

  • abbreviation (String, nil) (defaults to: nil)

    abbreviation



13
14
15
16
# File 'lib/relaton_bipm/document_type.rb', line 13

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

Instance Method Details

#check_type(type) ⇒ Object

Check if document type is valid.

Parameters:

  • type (String)

    document type



23
24
25
26
27
# File 'lib/relaton_bipm/document_type.rb', line 23

def check_type(type)
  # unless DOCTYPES.include? type
  #   Util.warn "invalid doctype: `#{type}`"
  # end
end