Sha256: 705ac9f1efafb6d0ce2d5adfc7d7a14207171583edb3927266ea5320e5f62f8b

Contents?: true

Size: 608 Bytes

Versions: 4

Compression:

Stored size: 608 Bytes

Contents

module Imb

  class BarPosition

    def initialize(descender_character_position, ascender_character_position)
      @descender_character_position = descender_character_position
      @ascender_character_position = ascender_character_position
    end

    def map(characters)
      2 * ascender_bit(characters) + descender_bit(characters)
    end

    private

    def descender_bit(characters)
      @descender_character_position.extract_bit_from_characters(characters)
    end

    def ascender_bit(characters)
      @ascender_character_position.extract_bit_from_characters(characters)
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
USPS-intelligent-barcode-0.2.0 lib/USPS-intelligent-barcode/BarPosition.rb
USPS-intelligent-barcode-0.1.2 lib/USPS-intelligent-barcode/BarPosition.rb
USPS-intelligent-barcode-0.1.1 lib/USPS-intelligent-barcode/BarPosition.rb
USPS-intelligent-barcode-0.1.0 lib/USPS-intelligent-barcode/BarPosition.rb