Class: RelatonBsi::DocumentType

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

Constant Summary collapse

DOCTYPES =
%w[
  british-standard draft-for-development published-document privately-subscribed-standard
  publicly-available-specification flex-standard international-standard technical-specification
  technical-report guide international-workshop-agreement industry-technical-agreement
  standard european-workshop-agreement fast-track-standard expert-commentary
].freeze

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of DocumentType.



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

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

Instance Method Details

#check_type(type) ⇒ Object



15
16
17
18
19
# File 'lib/relaton_bsi/document_type.rb', line 15

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