Sha256: 48b638ba1a0cd8c004ba6b17a23dc6dae5de9bcffbc8fde5e57fbdb86a310e46

Contents?: true

Size: 618 Bytes

Versions: 8

Compression:

Stored size: 618 Bytes

Contents

module Imb

  # @!group Internal

  # Represents the position of one bit in the array of intelligent
  # barcode "characters".

  class CharacterPosition

    # @param [Integer] character_index
    # @param [Integer] bit_number

    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.
    # @param [[Integer]] characters
    # @return [Integer] bit (0 or 1)

    def extract_bit_from_characters(characters)
      characters[@character_index][@bit_number]
    end

  end

end

Version data entries

8 entries across 7 versions & 2 rubygems

Version Path
usps_intelligent_barcode-0.3.1 lib/usps_intelligent_barcode/character_position.rb
USPS-intelligent-barcode-0.2.7 lib/USPS-intelligent-barcode/character_position.rb
USPS-intelligent-barcode-0.2.6 lib/USPS-intelligent-barcode/character_position.rb
usps_intelligent_barcode-0.3.0 lib/USPS-intelligent-barcode/character_position.rb
usps_intelligent_barcode-0.3.0 lib/usps_intelligent_barcode/character_position.rb
USPS-intelligent-barcode-0.2.5 lib/USPS-intelligent-barcode/character_position.rb
USPS-intelligent-barcode-0.2.4 lib/USPS-intelligent-barcode/character_position.rb
USPS-intelligent-barcode-0.2.3 lib/USPS-intelligent-barcode/CharacterPosition.rb