Class: RelatonEtsi::DocumentType

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

Constant Summary collapse

DOCTYPES =
{
  "EN" => "European Standard",
  "ES" => "ETSI Standard",
  "EG" => "ETSI Guide",
  "TS" => "Technical Specification",
  "GS" => "Group Specification",
  "GR" => "Group Report",
  "TR" => "Technical Report",
  "ETR" => "ETSI Technical Report",
  "GTS" => "GSM Technical Specification",
  "SR" => "Special Report",
  "TCRTR" => "Technical Committee Reference Technical Report",
  "TBR" => "Technical Basis for Regulation",
  "ETS" => "European Telecommunication Standard",
  "I-ETS" => "Interim European Telecommunication Standard",
  "NET" => "Norme Européenne de Télécommunication",
}.freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of DocumentType.



21
22
23
24
25
26
# File 'lib/relaton_etsi/document_type.rb', line 21

def initialize(type:, abbreviation: nil)
  check_type type
  check_abbreviation abbreviation
  abbreviation ||= DOCTYPES.key(type)
  super
end

Class Method Details

.create_from_abbreviation(abbreviation) ⇒ Object



28
29
30
# File 'lib/relaton_etsi/document_type.rb', line 28

def self.create_from_abbreviation(abbreviation)
  new type: DOCTYPES[abbreviation], abbreviation: abbreviation
end