-
Notifications
You must be signed in to change notification settings - Fork 170
/
gs1_128.rb
46 lines (31 loc) · 873 Bytes
/
gs1_128.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
require 'barby/barcode/code_128'
module Barby
#DEPRECATED - Use the Code128 class directly instead:
#
# Code128.new("#{Code128::FNC1}#{application_identifier}#{data}")
#
#AKA EAN-128, UCC-128
class GS1128 < Code128
attr_accessor :application_identifier
def initialize(data, type, ai)
warn "DEPRECATED: The GS1128 class has been deprecated, use Code128 directly instead (called from #{caller[0]})"
self.application_identifier = ai
super(data, type)
end
def data
FNC1+application_identifier+super
end
def partial_data
@data
end
def application_identifier_number
values[application_identifier]
end
def application_identifier_encoding
encodings[application_identifier_number]
end
def to_s
"(#{application_identifier}) #{partial_data}"
end
end
end