Module: Philiprehberger::Phone::VanityConversion

Defined in:
lib/philiprehberger/phone/vanity.rb

Class Method Summary collapse

Class Method Details

.vanity_to_digits(input) ⇒ Object



17
18
19
20
21
22
# File 'lib/philiprehberger/phone/vanity.rb', line 17

def self.vanity_to_digits(input)
  input.to_s.each_char.map do |char|
    upper = char.upcase
    VANITY_MAP[upper] || (char =~ /\d/ ? char : '')
  end.join
end