diff --git a/doc/default/address.md b/doc/default/address.md index 4ab3e02286..828818a0fc 100644 --- a/doc/default/address.md +++ b/doc/default/address.md @@ -17,10 +17,13 @@ Faker::Address.mail_box #=> "PO Box 123" Faker::Address.community #=> "University Crossing" +#note: #zip_code will return a random string in zipcode format; may or may not be a valid zip for locale Faker::Address.zip_code #=> "58517" or "23285-4905" +#note: #zip will return a random string in zipcode format; may or may not be a valid zip for locale Faker::Address.zip #=> "58517" or "66259-8212" +#note: #postcode will return a random string in postcode format; may or may not be a valid zip for locale Faker::Address.postcode #=> "76032-4907" or "58517" Faker::Address.time_zone #=> "Asia/Yakutsk" diff --git a/lib/faker/default/address.rb b/lib/faker/default/address.rb index fcbdb5b8e3..b82fb49a7a 100644 --- a/lib/faker/default/address.rb +++ b/lib/faker/default/address.rb @@ -119,8 +119,8 @@ def zip_code(state_abbreviation: '') return numerify(letterified_string, leading_zero: true) end - # provide a zip code that is valid for the state provided - # see http://www.fincen.gov/forms/files/us_state_territory_zip_codes.pdf + # provide a zip code that may be valid for the state provided + # note: zip code may appear in the correct format for the state provided but may not be an actual state zip. bothify(fetch("address.postcode_by_state.#{state_abbreviation}")) end