This is a library for representing phone numbers. It provides a Phoney class that can format phone numbers depending on the region you set.
- Gem
-
gem install phoney
- Source
-
git clone git://github.com/habermann24/phoney.git
-
Create phone number by parsing a string
require 'phoney' # region defaults to US Phoney.format("+17041234567") # => "+1 (704) 123-4567"
-
Deals with many specific region formatting rules (e.g. DE)
require 'phoney' Phoney.region = :de Phoney.format("04105456789") # => "04105 456789"
-
More tests for different countries