lib/USPS-intelligent-barcode/CharacterPosition.rb in USPS-intelligent-barcode-0.2.0 vs lib/USPS-intelligent-barcode/CharacterPosition.rb in USPS-intelligent-barcode-0.2.1
- old
+ new
@@ -1,12 +1,19 @@
module Imb
+ # Represents the position of one bit in the array of intelligent
+ # barcode "characters". This class is internal and may change.
+
class CharacterPosition
+ # Create.
+
def initialize(character_index, bit_number)
@character_index = character_index
@bit_number = bit_number
end
+
+ # Given an array of characters, return the bit for this position.
def extract_bit_from_characters(characters)
characters[@character_index][@bit_number]
end