Class Barby::Code25
In: lib/barby/barcode/code_25.rb
Parent: Barcode1D

Standard/Industrial 2 of 5, non-interleaved

Checksum not included by default, to include it, set include_checksum = true

Methods

Constants

WIDE = W = true
NARROW = N = false
START_ENCODING = [W,W,N]
STOP_ENCODING = [W,N,W]
ENCODINGS = { 0 => [N,N,W,W,N], 1 => [W,N,N,N,W], 2 => [N,W,N,N,W], 3 => [W,W,N,N,N], 4 => [N,N,W,N,W], 5 => [W,N,W,N,N], 6 => [N,W,W,N,N], 7 => [N,N,N,W,W], 8 => [W,N,N,W,N], 9 => [N,W,N,W,N]

Attributes

data  [RW] 
include_checksum  [RW] 
narrow_width  [RW] 
space_width  [RW] 
wide_width  [RW] 

Public Class methods

Public Instance methods

character_encodings()

Alias for digit_encodings

character_encodings_with_checksum()

Returns the encoding for a single digit

Generate encoding for an array of W,N

2 of 5 doesn‘t require a checksum, but you can include a Mod10 checksum by setting include_checksum to true

The width of a narrow bar in xdims

The width of the space between the bars in xdims By default the same width as a narrow bar

A space serves only as a separator for the bars, there is no encoded meaning in them

The width of a wide bar in xdims By default three times as wide as a narrow bar

[Validate]