lib/vindetta/transliterator.rb in vindetta-0.17.0 vs lib/vindetta/transliterator.rb in vindetta-0.17.1
- old
+ new
@@ -1,8 +1,12 @@
module Vindetta
class Transliterator
MAPPING = "0123456789.ABCDEFGH..JKLMN.P.R..STUVWXYZ".split("").freeze
+ def self.vin(vin)
+ vin.chars.map { |c| run(c) }
+ end
+
def self.run(character)
index = MAPPING.find_index(character)
raise Vindetta::InvalidCharacter, character unless index
index % 10
end