Sha256: 015bf3e391853a59dd483b7aa0a160821966a4e10aa084f304b735db9b54db71

Contents?: true

Size: 284 Bytes

Versions: 2

Compression:

Stored size: 284 Bytes

Contents

module Vindetta
  class Transliterator
    MAPPING = '0123456789.ABCDEFGH..JKLMN.P.R..STUVWXYZ'.split('').freeze

    def self.run(character)
      index = MAPPING.find_index(character)
      raise Vindetta::InvalidCharacter, character unless index
      index % 10
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vindetta-0.7.0 lib/vindetta/transliterator.rb
vindetta-0.6.0 lib/vindetta/transliterator.rb