Project

telefon

0.0
No commit activity in last 3 years
No release in over 3 years
Formats a number into a US phone number (e.g: (555) 123-9876).
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 1.2
 Project Readme

telefon

Formats a number into a US phone number (e.g: (555) 123-9876). You can customize the format in the options hash.

Usage

require "telefon"

Telefon.convert(5551234)                                     # => 555-1234
Telefon.convert("5551234")                                   # => 555-1234
Telefon.convert(1235551234)                                  # => 123-555-1234
Telefon.convert(1235551234, area_code: true)                 # => (123) 555-1234
Telefon.convert(1235551234, delimiter: " ")                  # => 123 555 1234
Telefon.convert(1235551234, area_code: true, extension: 555) # => (123) 555-1234 x 555
Telefon.convert(1235551234, country_code: 1)                 # => +1-123-555-1234

Telefon.convert(1235551234, country_code: 1, extension: 1343, delimiter: '.')
# => +1.123.555.1234 x 1343

Contributing

  • Fork the project.
  • Use make install to install dependencies.
  • Use make test to run the test suite.
  • Create a pull request with your changes.

Installation

$ gem install telefon