Module: Zebra::Epl::BarcodeType

Defined in:
lib/zebra/epl/barcode_type.rb

Defined Under Namespace

Classes: InvalidBarcodeTypeError

Constant Summary collapse

CODE_39 =
"3"
CODE_39_CHECK_DIGIT =
"3C"
CODE_93 =
"9"
CODE_128_AUTO =
"1"
CODE_128_A =
"1A"
CODE_128_B =
"1B"
CODE_128_C =
"1C"
CODABAR =
"K"

Class Method Summary collapse

Class Method Details

.valid_barcode_type?(type) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/zebra/epl/barcode_type.rb', line 15

def self.valid_barcode_type?(type)
  %w(3 3C 9 1 1A 1B 1C K).include? type
end

.validate_barcode_type(type) ⇒ Object



19
20
21
# File 'lib/zebra/epl/barcode_type.rb', line 19

def self.validate_barcode_type(type)
  raise InvalidBarcodeTypeError unless valid_barcode_type?(type)
end