Project

phoney

0.03
No commit activity in last 3 years
No release in over 3 years
Ruby library that parses a phone number and automatically formats it correctly, depending on the country/locale you set.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
 Project Readme

phoney¶ ↑

This is a library for representing phone numbers. It provides a Phoney class that can format phone numbers depending on the region you set.

Installation¶ ↑

Gem

gem install phoney

Source

git clone git://github.com/habermann24/phoney.git

Feature overview¶ ↑

  • 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"
    

TODOs¶ ↑

  • More tests for different countries