Module: Asciidoctor::Diagram::BarcodeProcessor

Included in:
BarcodeBlockMacroProcessor, BarcodeBlockProcessor, BarcodeInlineMacroProcessor
Defined in:
lib/asciidoctor-diagram/barcode/extension.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.check_config(config = {}) ⇒ Object



7
8
9
10
11
# File 'lib/asciidoctor-diagram/barcode/extension.rb', line 7

def self.check_config(config = {})
  type = config[:type]
  raise "Barcode type not specified in config" if type.nil?
  raise "Unsupported barcode type: '#{type}'" unless BarcodeConverter::BARCODE_TYPES.include?(type)
end

Instance Method Details

#initialize(name = nil, config = {}) ⇒ Object



13
14
15
16
# File 'lib/asciidoctor-diagram/barcode/extension.rb', line 13

def initialize(name = nil, config = {})
  super
  BarcodeProcessor.check_config(config)
end