Skip to content

Commit

Permalink
Update phone number documentation (#1862)
Browse files Browse the repository at this point in the history
* Update Faker::PhoneNumber documentation

This helps explain the difference between the `.phone_number` and `.cell_phone` formatters.

* Remove duplicate phone_number formats
  • Loading branch information
davidmyersdev authored and vbrazo committed Dec 17, 2019
1 parent 41d827d commit 233a923
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
24 changes: 19 additions & 5 deletions doc/default/phone_number.md
@@ -1,21 +1,35 @@
# Faker::PhoneNumber
# `Faker::PhoneNumber`

Phone numbers may be in any of the following formats:
### `.phone_number`

This formatter will return one of the following formats:

* 333-333-3333
* (333) 333-3333
* 1-333-333-3333
* 333.333.3333
* 333-333-3333
* 333-333-3333 x3333
* (333) 333-3333 x3333
* 1-333-333-3333 x3333
* 333.333.3333 x3333

(Don't let the example output below fool you - any format can be returned at random.)
Note: For formats with extensions, the extension can be inclusively between 3 and 5 digits long.

### `.cell_phone`

This formatter will return one of the following formats:

* 333-333-3333
* (333) 333-3333
* 1-333-333-3333
* 333.333.3333

## Usage

Don't let the example output below fool you -- any format can be returned at random.

```ruby
Faker::PhoneNumber.phone_number #=> "397.693.1309"
Faker::PhoneNumber.phone_number #=> "397.693.1309 x4321"

Faker::PhoneNumber.cell_phone #=> "(186)285-7925"

Expand Down
2 changes: 1 addition & 1 deletion lib/locales/en/phone_number.yml
@@ -1,7 +1,7 @@
en:
faker:
phone_number:
formats: ['###-###-####', '(###) ###-####', '1-###-###-####', '###.###.####', '###-###-####', '(###) ###-####', '1-###-###-####', '###.###.####', '###-###-#### x###', '(###) ###-#### x###', '1-###-###-#### x###', '###.###.#### x###', '###-###-#### x####', '(###) ###-#### x####', '1-###-###-#### x####', '###.###.#### x####', '###-###-#### x#####', '(###) ###-#### x#####', '1-###-###-#### x#####', '###.###.#### x#####']
formats: ['###-###-####', '(###) ###-####', '1-###-###-####', '###.###.####', '###-###-#### x###', '(###) ###-#### x###', '1-###-###-#### x###', '###.###.#### x###', '###-###-#### x####', '(###) ###-#### x####', '1-###-###-#### x####', '###.###.#### x####', '###-###-#### x#####', '(###) ###-#### x#####', '1-###-###-#### x#####', '###.###.#### x#####']
cell_phone:
formats: ['###-###-####', '(###) ###-####', '1-###-###-####', '###.###.####']
country_code: ["1", "1-242", "1-246", "1-264", "1-268", "1-284", "1-340", "1-345", "1-441", "1-473", "1-649", "1-670", "1-671", "1-684", "1-758", "1-784", "1-787", "1-868", "1-869", "1-876", "1-939", "20", "212", "213", "216", "218", "220", "221", "222", "223", "224", "225", "226", "227", "228", "229", "230", "231", "232", "233", "234", "235", "236", "238", "238", "239", "240", "241", "242", "243", "244", "245", "247", "248", "249", "250", "251", "252", "253", "254", "255", "256", "257", "258", "260", "261", "262", "263", "264", "265", "266", "267", "268", "269", "269", "27", "290", "291", "297", "298", "299", "30", "31", "32", "33", "33", "34", "350", "351", "352", "353", "354", "355", "356", "357", "358", "359", "36", "370", "371", "372", "373", "374", "375", "376", "378", "380", "381", "381", "381", "385", "386", "387", "389", "39", "39", "40", "41", "420", "421", "423", "43", "44", "45", "46", "47", "48", "49", "500", "501", "502", "503", "504", "505", "506", "507", "508", "509", "51", "52", "53", "54", "55", "56", "57", "58", "591", "592", "593", "594", "595", "596", "596", "597", "598", "599", "60", "61", "61-8", "62", "63", "64", "65", "66", "670", "672", "673", "674", "675", "676", "677", "678", "679", "680", "681", "682", "683", "685", "686", "687", "688", "689", "690", "691", "692", "7", "7-6", "7-7", "767", "809", "809", "809", "81", "82", "84", "850", "850", "852", "853", "855", "855", "856", "86", "880", "886", "886", "90", "91", "92", "93", "94", "95", "960", "961", "962", "963", "964", "965", "966", "967", "968", "971", "972", "973", "974", "975", "976", "977", "98", "993", "994", "995", "996"]

0 comments on commit 233a923

Please sign in to comment.