Sha256: 1ed3b52cae8ab557690fa44f5e0051a4f073898c520a33bf03ad3704570808ab
Contents?: true
Size: 437 Bytes
Versions: 20
Compression:
Stored size: 437 Bytes
Contents
module FSR module Utils module DTMF MAP = Hash[ [%w{a b c}, %w{d e f}, %w{g h i}, %w{j k l}, %w{m n o}, %w{p q r s}, %w{t u v}, %w{w x y z} ].zip((2 .. 9).to_a) ] def self.from_string(dtmf) dtmf.each_char.map { |char| MAP[MAP.keys.detect { |k| k.include? char }] || char }.join end end end end
Version data entries
20 entries across 20 versions & 1 rubygems