Class: Imb::CodewordMap
- Inherits:
-
Object
- Object
- Imb::CodewordMap
- Defined in:
- lib/USPS-intelligent-barcode/codeword_map.rb
Overview
Maps codewords to characters.
Internal collapse
-
#characters(codewords) ⇒ [Integer]
Given an array of codewords, ruturn their characters.
-
#initialize ⇒ CodewordMap
constructor
Constructor.
Constructor Details
#initialize ⇒ CodewordMap
Constructor
11 12 13 |
# File 'lib/USPS-intelligent-barcode/codeword_map.rb', line 11 def initialize @characters = load_characters end |
Instance Method Details
#characters(codewords) ⇒ [Integer]
Given an array of codewords, ruturn their characters.
19 20 21 22 23 |
# File 'lib/USPS-intelligent-barcode/codeword_map.rb', line 19 def characters(codewords) codewords.map do |codeword| @characters[codeword] end end |