forked from toretore/barby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
29 lines (23 loc) · 1.65 KB
/
README
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
Barby is a Ruby barcode generator. It does not depend on other libraries
(for the core functionality) and is easily extentable.
The barcode objects are separated from the process of generating graphical
(or other) representations. A barcode's only responsibility is to provide
a string representation consisting of 1s and 0s representing bars and spaces.
This string can then be used to generate (for example) an image with the
RMagickOutputter, or an ASCII string such as the one below.
See Barby::Barcode and Barby::Outputter for more information.
require 'barby'
require 'barby/outputter/ascii_outputter'
barcode = Barby::Code128B.new('BARBY')
puts barcode.to_ascii
## # # # # ## # # ## ## # ### # # ## ### ## # ## ### ### ## ### # ##
## # # # # ## # # ## ## # ### # # ## ### ## # ## ### ### ## ### # ##
## # # # # ## # # ## ## # ### # # ## ### ## # ## ### ### ## ### # ##
## # # # # ## # # ## ## # ### # # ## ### ## # ## ### ### ## ### # ##
## # # # # ## # # ## ## # ### # # ## ### ## # ## ### ### ## ### # ##
## # # # # ## # # ## ## # ### # # ## ### ## # ## ### ### ## ### # ##
## # # # # ## # # ## ## # ### # # ## ### ## # ## ### ### ## ### # ##
## # # # # ## # # ## ## # ### # # ## ### ## # ## ### ### ## ### # ##
## # # # # ## # # ## ## # ### # # ## ### ## # ## ### ### ## ### # ##
## # # # # ## # # ## ## # ### # # ## ### ## # ## ### ### ## ### # ##
B A R B Y