Class: Imb::BarMap
- Inherits:
-
Object
- Object
- Imb::BarMap
- Defined in:
- lib/USPS-intelligent-barcode/bar_map.rb
Overview
Maps intelligent barcode “characters” to codes that indicate what type of bar to print at each given position.
Internal collapse
-
#initialize ⇒ BarMap
constructor
A new instance of BarMap.
-
#symbols(characters) ⇒ [BarSymbol]
Given an array of intelligent barcode “characters”, return an the symbols for each position.
Constructor Details
#initialize ⇒ BarMap
Returns a new instance of BarMap.
12 13 14 |
# File 'lib/USPS-intelligent-barcode/bar_map.rb', line 12 def initialize @mapping = load_mapping end |
Instance Method Details
#symbols(characters) ⇒ [BarSymbol]
Given an array of intelligent barcode “characters”, return an the symbols for each position.
21 22 23 24 25 |
# File 'lib/USPS-intelligent-barcode/bar_map.rb', line 21 def symbols(characters) @mapping.map do || .map(characters) end end |