Sha256: 1f89d416e19d0df81235325ada24b9ad32279c7a9d4ab4caf36b3bd026e32bc8

Contents?: true

Size: 284 Bytes

Versions: 10

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

10 entries across 10 versions & 1 rubygems

Version Path
vindetta-0.17.0 lib/vindetta/transliterator.rb
vindetta-0.16.0 lib/vindetta/transliterator.rb
vindetta-0.15.0 lib/vindetta/transliterator.rb
vindetta-0.14.0 lib/vindetta/transliterator.rb
vindetta-0.13.0 lib/vindetta/transliterator.rb
vindetta-0.12.0 lib/vindetta/transliterator.rb
vindetta-0.11.0 lib/vindetta/transliterator.rb
vindetta-0.10.0 lib/vindetta/transliterator.rb
vindetta-0.9.0 lib/vindetta/transliterator.rb
vindetta-0.8.0 lib/vindetta/transliterator.rb