Current section

29 Versions

Jump to

Compare versions

66 files changed
+15186 additions
-816 deletions
  @@ -4,41 +4,46 @@
4 4 <<"Faker is a pure Elixir library for generating fake data.">>}.
5 5 {<<"elixir">>,<<"~> 1.3">>}.
6 6 {<<"files">>,
7 - [<<"lib">>,<<"lib/faker">>,<<"lib/faker.ex">>,<<"lib/faker/address.ex">>,
8 - <<"lib/faker/app.ex">>,<<"lib/faker/avatar.ex">>,<<"lib/faker/beer">>,
9 - <<"lib/faker/beer.ex">>,<<"lib/faker/beer/en.ex">>,
10 - <<"lib/faker/bitcoin.ex">>,<<"lib/faker/cat">>,<<"lib/faker/cat.ex">>,
11 - <<"lib/faker/cat/cat.ex">>,<<"lib/faker/code">>,<<"lib/faker/code.ex">>,
12 - <<"lib/faker/code/iban.ex">>,<<"lib/faker/color">>,<<"lib/faker/color.ex">>,
13 - <<"lib/faker/color/en.ex">>,<<"lib/faker/commerce">>,
14 - <<"lib/faker/commerce.ex">>,<<"lib/faker/commerce/en.ex">>,
15 - <<"lib/faker/company">>,<<"lib/faker/company.ex">>,
16 - <<"lib/faker/company/en.ex">>,<<"lib/faker/date.ex">>,
17 - <<"lib/faker/datetime.ex">>,<<"lib/faker/file.ex">>,<<"lib/faker/gov">>,
18 - <<"lib/faker/gov/us.ex">>,<<"lib/faker/industry">>,
7 + [<<"lib">>,<<"lib/faker">>,<<"lib/faker.ex">>,<<"lib/faker/address">>,
8 + <<"lib/faker/address.ex">>,<<"lib/faker/address/en.ex">>,
9 + <<"lib/faker/address/es.ex">>,<<"lib/faker/app.ex">>,
10 + <<"lib/faker/avatar.ex">>,<<"lib/faker/beer">>,<<"lib/faker/beer.ex">>,
11 + <<"lib/faker/beer/en.ex">>,<<"lib/faker/bitcoin.ex">>,<<"lib/faker/cat">>,
12 + <<"lib/faker/cat.ex">>,<<"lib/faker/cat/en.ex">>,<<"lib/faker/code">>,
13 + <<"lib/faker/code.ex">>,<<"lib/faker/code/iban.ex">>,<<"lib/faker/color">>,
14 + <<"lib/faker/color.ex">>,<<"lib/faker/color/en.ex">>,
15 + <<"lib/faker/color/es.ex">>,<<"lib/faker/color/pt_br.ex">>,
16 + <<"lib/faker/commerce">>,<<"lib/faker/commerce.ex">>,
17 + <<"lib/faker/commerce/en.ex">>,<<"lib/faker/company">>,
18 + <<"lib/faker/company.ex">>,<<"lib/faker/company/en.ex">>,
19 + <<"lib/faker/date.ex">>,<<"lib/faker/datetime.ex">>,<<"lib/faker/file.ex">>,
20 + <<"lib/faker/food">>,<<"lib/faker/food.ex">>,<<"lib/faker/food/en.ex">>,
21 + <<"lib/faker/gov">>,<<"lib/faker/gov/us.ex">>,<<"lib/faker/industry">>,
19 22 <<"lib/faker/industry.ex">>,<<"lib/faker/industry/en.ex">>,
20 23 <<"lib/faker/internet">>,<<"lib/faker/internet.ex">>,
21 - <<"lib/faker/internet/en.ex">>,<<"lib/faker/internet/user_agent.ex">>,
24 + <<"lib/faker/internet/en.ex">>,<<"lib/faker/internet/es.ex">>,
25 + <<"lib/faker/internet/pt_br.ex">>,<<"lib/faker/internet/user_agent.ex">>,
22 26 <<"lib/faker/lorem">>,<<"lib/faker/lorem.ex">>,
23 27 <<"lib/faker/lorem/shakespeare">>,<<"lib/faker/lorem/shakespeare.ex">>,
24 28 <<"lib/faker/lorem/shakespeare/en.ex">>,
25 29 <<"lib/faker/lorem/shakespeare/ru.ex">>,<<"lib/faker/naivedatetime.ex">>,
26 30 <<"lib/faker/name">>,<<"lib/faker/name.ex">>,<<"lib/faker/name/en.ex">>,
31 + <<"lib/faker/name/es.ex">>,<<"lib/faker/name/pt_br.ex">>,
27 32 <<"lib/faker/nato.ex">>,<<"lib/faker/phone">>,
28 33 <<"lib/faker/phone/en_gb.ex">>,<<"lib/faker/phone/en_us.ex">>,
29 34 <<"lib/faker/pizza.ex">>,<<"lib/faker/pokemon">>,<<"lib/faker/pokemon.ex">>,
30 35 <<"lib/faker/pokemon/en.ex">>,<<"lib/faker/random">>,
31 36 <<"lib/faker/random.ex">>,<<"lib/faker/random/elixir.ex">>,
32 - <<"lib/faker/star_wars">>,<<"lib/faker/star_wars.ex">>,
33 - <<"lib/faker/star_wars/en.ex">>,<<"lib/faker/string.ex">>,
34 - <<"lib/faker/superhero">>,<<"lib/faker/superhero.ex">>,
35 - <<"lib/faker/superhero/en.ex">>,<<"lib/faker/team">>,
36 - <<"lib/faker/team.ex">>,<<"lib/faker/team/en.ex">>,<<"lib/faker/util">>,
37 - <<"lib/faker/util.ex">>,<<"lib/faker/util/en.ex">>,<<"mix.exs">>,
37 + <<"lib/faker/random/test.ex">>,<<"lib/faker/star_wars">>,
38 + <<"lib/faker/star_wars.ex">>,<<"lib/faker/star_wars/en.ex">>,
39 + <<"lib/faker/string.ex">>,<<"lib/faker/superhero">>,
40 + <<"lib/faker/superhero.ex">>,<<"lib/faker/superhero/en.ex">>,
41 + <<"lib/faker/team">>,<<"lib/faker/team.ex">>,<<"lib/faker/team/en.ex">>,
42 + <<"lib/faker/team/pt_br.ex">>,<<"lib/faker/util">>,<<"lib/faker/util.ex">>,
43 + <<"lib/faker/util/en.ex">>,<<"lib/faker/uuid.ex">>,<<"mix.exs">>,
38 44 <<"mix.lock">>]}.
39 45 {<<"licenses">>,[<<"MIT">>]}.
40 46 {<<"links">>,[{<<"GitHub">>,<<"https://github.com/igas/faker">>}]}.
41 - {<<"maintainers">>,[<<"Igor Kapkov">>,<<"Toby Hinloopen">>]}.
42 47 {<<"name">>,<<"faker">>}.
43 48 {<<"requirements">>,[]}.
44 - {<<"version">>,<<"0.10.0">>}.
49 + {<<"version">>,<<"0.11.0">>}.
  @@ -17,7 +17,7 @@ defmodule Faker do
17 17 @spec start(atom) :: :ok
18 18 def start(lang) when is_atom(lang) do
19 19 :application.start(:faker)
20 - Faker.locale(lang)
20 + locale(lang)
21 21 :ok
22 22 end
23 23
  @@ -26,21 +26,21 @@ defmodule Faker do
26 26
27 27 It replaces `"#"` to random number and `"?"` to random latin letter.
28 28 """
29 - @spec format(String.t) :: String.t
29 + @spec format(String.t()) :: String.t()
30 30 def format(str) when is_binary(str) do
31 31 format(str, "")
32 32 end
33 33
34 - defp format(<<"#" :: utf8, tail :: binary>>, acc) do
35 - format(tail, <<acc :: binary, "#{Faker.random_between(0, 9)}">>)
34 + defp format(<<"#"::utf8, tail::binary>>, acc) do
35 + format(tail, <<acc::binary, "#{random_between(0, 9)}">>)
36 36 end
37 37
38 - defp format(<<"?" :: utf8, tail :: binary>>, acc) do
39 - format(tail, <<acc :: binary, letter()>>)
38 + defp format(<<"?"::utf8, tail::binary>>, acc) do
39 + format(tail, <<acc::binary, letter()>>)
40 40 end
41 41
42 - defp format(<<other :: utf8, tail :: binary>>, acc) do
43 - format(tail, <<acc :: binary, other>>)
42 + defp format(<<other::utf8, tail::binary>>, acc) do
43 + format(tail, <<acc::binary, other>>)
44 44 end
45 45
46 46 defp format("", acc) do
  @@ -49,15 +49,19 @@ defmodule Faker do
49 49
50 50 @alphabet 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
51 51 defp letter do
52 - Enum.at(@alphabet, Faker.random_between(0, Enum.count(@alphabet) - 1))
52 + Enum.at(@alphabet, random_between(0, Enum.count(@alphabet) - 1))
53 53 end
54 54
55 55 @doc """
56 56 Returns application locale ready for module constract.
57 57 """
58 - @spec mlocale() :: String.t
58 + @spec mlocale() :: String.t()
59 59 def mlocale do
60 - String.capitalize(to_string(Faker.locale))
60 + if Faker.country() do
61 + String.capitalize(to_string(Faker.locale())) <> String.capitalize(to_string(Faker.country()))
62 + else
63 + String.capitalize(to_string(Faker.locale()))
64 + end
61 65 end
62 66
63 67 @doc """
  @@ -68,6 +72,14 @@ defmodule Faker do
68 72 Application.get_env(:faker, :locale)
69 73 end
70 74
75 + @doc """
76 + Returns application country.
77 + """
78 + @spec country() :: atom
79 + def country do
80 + Application.get_env(:faker, :country)
81 + end
82 +
71 83 @doc """
72 84 Sets application locale.
73 85 """
  @@ -110,9 +122,27 @@ defmodule Faker do
110 122 Application.get_env(:faker, :random_module).random_bytes(total)
111 123 end
112 124
125 + defmacro localize(function) do
126 + quote do
127 + def unquote(function)() do
128 + module = Module.concat(unquote(__CALLER__.module), Faker.mlocale())
129 + cond do
130 + function_exported?(module, unquote(function), 0) ->
131 + apply(module, unquote(function), [])
132 + function_exported?(module, unquote(function), EnUs) ->
133 + apply(Module.concat(unquote(__CALLER__.module), EnUs), unquote(function), [])
134 + true ->
135 + apply(Module.concat(unquote(__CALLER__.module), En), unquote(function), [])
136 + end
137 + end
138 + end
139 + end
140 +
113 141 defmacro sampler(name, data) do
114 142 count = Enum.count(data)
115 - mapped_data = data |> Enum.with_index |> Enum.into(%{}, fn({k, v}) -> {v, k} end) |> Macro.escape()
143 +
144 + mapped_data =
145 + data |> Enum.with_index() |> Enum.into(%{}, fn {k, v} -> {v, k} end) |> Macro.escape()
116 146
117 147 quote do
118 148 def unquote(name)() do
  @@ -124,7 +154,9 @@ defmodule Faker do
124 154
125 155 defmacro samplerp(name, data) do
126 156 count = Enum.count(data)
127 - mapped_data = data |> Enum.with_index |> Enum.into(%{}, fn({k, v}) -> {v, k} end) |> Macro.escape()
157 +
158 + mapped_data =
159 + data |> Enum.with_index() |> Enum.into(%{}, fn {k, v} -> {v, k} end) |> Macro.escape()
128 160
129 161 quote do
130 162 defp unquote(name)() do
  @@ -1,154 +1,428 @@
1 1 defmodule Faker.Address do
2 - import Faker, only: [sampler: 2]
3 -
4 2 alias Faker.Name
5 3
4 + @geobase32 '0123456789bcdefghjkmnpqrstuvwxyz'
5 +
6 6 @moduledoc """
7 7 Functions for generating addresses.
8 8 """
9 9
10 10 @doc """
11 11 Return random building number.
12 +
13 + ## Examples
14 +
15 + iex> Faker.Address.building_number()
16 + "15426"
17 + iex> Faker.Address.building_number()
18 + "6"
19 + iex> Faker.Address.building_number()
20 + "0832"
21 + iex> Faker.Address.building_number()
22 + "7"
12 23 """
13 - @spec building_number() :: String.t
24 + @spec building_number() :: String.t()
14 25 def building_number do
15 - ["#####", "####", "###", "##", "#"]
16 - |> Enum.at(Faker.random_between(0, 4))
17 - |> Faker.format
26 + localised_module().building_number
18 27 end
19 28
20 29 @doc """
21 30 Return city name.
22 - """
23 - @spec city() :: String.t
24 - def city do
25 - city(Faker.random_between(0, 3))
26 - end
27 31
28 - defp city(0), do: "#{city_prefix()} #{Name.first_name}#{city_suffix()}"
29 - defp city(1), do: "#{city_prefix()} #{Name.first_name}"
30 - defp city(2), do: "#{Name.first_name}#{city_suffix()}"
31 - defp city(3), do: "#{Name.last_name}#{city_suffix()}"
32 + ## Examples
33 +
34 + iex> Faker.Address.city()
35 + "Elizabeth"
36 + iex> Faker.Address.city()
37 + "Rolfson"
38 + iex> Faker.Address.city()
39 + "West Conor"
40 + iex> Faker.Address.city()
41 + "Hardy"
42 + """
43 + @spec city() :: String.t()
44 + def city do
45 + localised_module().city
46 + end
32 47
33 48 @doc """
34 49 Return city prefix.
50 +
51 + ## Examples
52 +
53 + iex> Faker.Address.city_prefix()
54 + "Port"
55 + iex> Faker.Address.city_prefix()
56 + "West"
57 + iex> Faker.Address.city_prefix()
58 + "North"
59 + iex> Faker.Address.city_prefix()
60 + "Lake"
35 61 """
36 - @spec city_prefix() :: String.t
37 - sampler :city_prefix, ["North", "East", "West", "South", "New", "Lake", "Port"]
62 + @spec city_prefix() :: String.t()
63 + def city_prefix do
64 + localised_module().city_prefix
65 + end
38 66
39 67 @doc """
40 68 Return city suffix.
69 +
70 + ## Examples
71 +
72 + iex> Faker.Address.city_suffix()
73 + "burgh"
74 + iex> Faker.Address.city_suffix()
75 + "mouth"
76 + iex> Faker.Address.city_suffix()
77 + "burgh"
78 + iex> Faker.Address.city_suffix()
79 + "view"
41 80 """
42 - @spec city_suffix() :: String.t
43 - sampler :city_suffix, ["town", "ton", "land", "ville", "berg", "burgh", "borough", "bury", "view", "port", "mouth", "stad", "furt", "chester", "mouth", "fort", "haven", "side", "shire"]
81 + @spec city_suffix() :: String.t()
82 + def city_suffix do
83 + localised_module().city_suffix
84 + end
44 85
45 86 @doc """
46 87 Return country.
88 +
89 + ## Examples
90 +
91 + iex> Faker.Address.country()
92 + "China"
93 + iex> Faker.Address.country()
94 + "Macedonia"
95 + iex> Faker.Address.country()
96 + "China"
97 + iex> Faker.Address.country()
98 + "Venezuela"
47 99 """
48 - @spec country() :: String.t
49 - sampler :country, ["Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica (the territory South of 60 deg S)", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Bouvet Island (Bouvetoya)", "Brazil", "British Indian Ocean Territory (Chagos Archipelago)", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Faroe Islands", "Falkland Islands (Malvinas)", "Fiji", "Finland", "France", "French Guiana", "French Polynesia", "French Southern Territories", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guernsey", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard Island and McDonald Islands", "Holy See (Vatican City State)", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Isle of Man", "Israel", "Italy", "Jamaica", "Japan", "Jersey", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Democratic People's Republic of Korea", "Republic of Korea", "Kuwait", "Kyrgyz Republic", "Lao People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libyan Arab Jamahiriya", "Liechtenstein", "Lithuania", "Luxembourg", "Macao", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Montenegro", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands Antilles", "Netherlands", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Palestinian Territory", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn Islands", "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda", "Saint Barthelemy", "Saint Helena", "Saint Kitts and Nevis", "Saint Lucia", "Saint Martin", "Saint Pierre and Miquelon", "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia", "Seychelles", "Sierra Leone", "Singapore", "Slovakia (Slovak Republic)", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "Spain", "Sri Lanka", "Sudan", "Suriname", "Svalbard & Jan Mayen Islands", "Swaziland", "Sweden", "Switzerland", "Syrian Arab Republic", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Timor-Leste", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States of America", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "'Virgin Islands", "British'", "'Virgin Islands", "U.S.'", "Wallis and Futuna", "Western Sahara", "Yemen", "Zambia", "Zimbabwe"]
100 + @spec country() :: String.t()
101 + def country do
102 + localised_module().country
103 + end
50 104
51 105 @doc """
52 106 Return country code.
107 +
108 + ## Examples
109 +
110 + iex> Faker.Address.country_code()
111 + "IT"
112 + iex> Faker.Address.country_code()
113 + "MR"
114 + iex> Faker.Address.country_code()
115 + "GM"
116 + iex> Faker.Address.country_code()
117 + "CX"
53 118 """
54 - @spec country_code() :: String.t
55 - sampler :country_code, ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW"]
119 + @spec country_code() :: String.t()
120 + def country_code do
121 + localised_module().country_code
122 + end
123 +
124 + @doc """
125 + Returns a geohash.
126 +
127 + ## Examples
128 +
129 + iex> Faker.Address.geohash()
130 + "1kgw0"
131 + iex> Faker.Address.geohash()
132 + "575152tr612btt"
133 + iex> Faker.Address.geohash()
134 + "20kxxzd9k22m6jedp"
135 + iex> Faker.Address.geohash()
136 + "06kjmd2wtwjp2px"
137 + """
138 + @spec geohash() :: binary
139 + def geohash do
140 + bits = encode_to_bits(latitude(), longitude(), Faker.random_between(5, 25) * 5)
141 +
142 + to_geobase32(bits)
143 + end
144 +
145 + defp encode_to_bits(lat, lon, bits_length) do
146 + starting_position = bits_length - 1
147 + # odd bits
148 + lat_bits = lat_to_bits(lat, starting_position - 1)
149 + # even bits
150 + lon_bits = lon_to_bits(lon, starting_position)
151 + geo_bits = lat_bits + lon_bits
152 + <<geo_bits::size(bits_length)>>
153 + end
154 +
155 + defp to_geobase32(bits) do
156 + chars = for <<c::5 <- bits>>, do: Enum.fetch!(@geobase32, c)
157 + chars |> to_string
158 + end
159 +
160 + defp lon_to_bits(lon, position) do
161 + geo_to_bits(lon, position, {-180.0, 180.0})
162 + end
163 +
164 + defp lat_to_bits(lat, position) do
165 + geo_to_bits(lat, position, {-90.0, 90.0})
166 + end
167 +
168 + defp geo_to_bits(_, position, _) when position < 0 do
169 + 0
170 + end
171 +
172 + defp geo_to_bits(n, position, {gmin, gmax}) do
173 + mid = (gmin + gmax) / 2
174 +
175 + if n >= mid do
176 + round(:math.pow(2, position)) + geo_to_bits(n, position - 2, {mid, gmax})
177 + else
178 + geo_to_bits(n, position - 2, {gmin, mid})
179 + end
180 + end
56 181
57 182 @doc """
58 183 Return random latitude.
184 +
185 + ## Examples
186 +
187 + iex> Faker.Address.latitude()
188 + -62.20459142744528
189 + iex> Faker.Address.latitude()
190 + -59.39243543011051
191 + iex> Faker.Address.latitude()
192 + 15.346881460762518
193 + iex> Faker.Address.latitude()
194 + -72.94522080668256
59 195 """
60 196 @spec latitude() :: float
61 197 def latitude do
62 - ((Faker.random_uniform * 180) - 90)
198 + Faker.random_uniform() * 180 - 90
63 199 end
64 200
65 201 @doc """
66 202 Return random longitude.
203 +
204 + ## Examples
205 +
206 + iex> Faker.Address.longitude()
207 + -124.40918285489056
208 + iex> Faker.Address.longitude()
209 + -118.78487086022102
210 + iex> Faker.Address.longitude()
211 + 30.693762921525035
212 + iex> Faker.Address.longitude()
213 + -145.8904416133651
67 214 """
68 215 @spec longitude() :: float
69 216 def longitude do
70 - ((Faker.random_uniform * 360) - 180)
217 + Faker.random_uniform() * 360 - 180
71 218 end
72 219
73 220 @doc """
74 221 Return random postcode.
222 +
223 + ## Examples
224 +
225 + iex> Faker.Address.postcode()
226 + "01542"
227 + iex> Faker.Address.postcode()
228 + "64610"
229 + iex> Faker.Address.postcode()
230 + "83297"
231 + iex> Faker.Address.postcode()
232 + "05235"
75 233 """
76 - @spec postcode() :: String.t
234 + @spec postcode() :: String.t()
77 235 defdelegate postcode, to: __MODULE__, as: :zip_code
78 236
79 237 @doc """
80 238 Return random secondary address.
239 +
240 + ## Examples
241 +
242 + iex> Faker.Address.secondary_address()
243 + "Apt. 154"
244 + iex> Faker.Address.secondary_address()
245 + "Apt. 646"
246 + iex> Faker.Address.secondary_address()
247 + "Suite 083"
248 + iex> Faker.Address.secondary_address()
249 + "Apt. 970"
81 250 """
82 - @spec secondary_address() :: String.t
251 + @spec secondary_address() :: String.t()
83 252 def secondary_address do
84 - ["Apt. ###", "Suite ###"]
85 - |> Enum.at(Faker.random_between(0, 1))
86 - |> Faker.format
253 + localised_module().secondary_address
87 254 end
88 255
89 256 @doc """
90 257 Return state.
258 +
259 + ## Examples
260 +
261 + iex> Faker.Address.state()
262 + "Hawaii"
263 + iex> Faker.Address.state()
264 + "Alaska"
265 + iex> Faker.Address.state()
266 + "Oklahoma"
267 + iex> Faker.Address.state()
268 + "California"
91 269 """
92 - @spec state() :: String.t
93 - sampler :state, ["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"]
270 + @spec state() :: String.t()
271 + def state do
272 + localised_module().state
273 + end
94 274
95 275 @doc """
96 276 Return state abbr.
277 +
278 + ## Examples
279 +
280 + iex> Faker.Address.state_abbr()
281 + "HI"
282 + iex> Faker.Address.state_abbr()
283 + "AK"
284 + iex> Faker.Address.state_abbr()
285 + "OK"
286 + iex> Faker.Address.state_abbr()
287 + "CA"
97 288 """
98 - @spec state_abbr() :: String.t
99 - sampler :state_abbr, ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"]
289 + @spec state_abbr() :: String.t()
290 + def state_abbr do
291 + localised_module().state_abbr
292 + end
100 293
101 294 @doc """
102 295 Return street address.
296 +
297 + ## Examples
298 +
299 + iex> Faker.Address.street_address()
300 + "15426 Aniya Mews"
301 + iex> Faker.Address.street_address()
302 + "83297 Jana Spring"
303 + iex> Faker.Address.street_address()
304 + "57 Helene Mission"
305 + iex> Faker.Address.street_address()
306 + "03 Izaiah Land"
103 307 """
104 - @spec street_address() :: String.t
308 + @spec street_address() :: String.t()
105 309 def street_address do
106 310 "#{building_number()} #{street_name()}"
107 311 end
108 312
109 313 @doc """
110 314 Return `street_address/0` or if argument is `true` adds `secondary_address/0`.
315 +
316 + ## Examples
317 +
318 + iex> Faker.Address.street_address(true)
319 + "15426 Aniya Mews Apt. 832"
320 + iex> Faker.Address.street_address(true)
321 + "7 Jana Spring Suite 570"
322 + iex> Faker.Address.street_address(true)
323 + "030 Kozey Knoll Suite 733"
324 + iex> Faker.Address.street_address(true)
325 + "603 Homenick Shore Suite 981"
111 326 """
112 - @spec street_address(true | any) :: String.t
327 + @spec street_address(true | any) :: String.t()
113 328 def street_address(true), do: street_address() <> " " <> secondary_address()
114 329 def street_address(_), do: street_address()
115 330
116 331 @doc """
117 332 Return street name.
333 +
334 + ## Examples
335 +
336 + iex> Faker.Address.street_name()
337 + "Elizabeth Freeway"
338 + iex> Faker.Address.street_name()
339 + "Reese Plaza"
340 + iex> Faker.Address.street_name()
341 + "Aniya Mews"
342 + iex> Faker.Address.street_name()
343 + "Bianka Heights"
118 344 """
119 - @spec street_name() :: String.t
345 + @spec street_name() :: String.t()
120 346 def street_name do
121 347 street_name(Faker.random_between(0, 1))
122 348 end
123 349
124 - defp street_name(0), do: "#{Name.first_name} #{street_suffix()}"
125 - defp street_name(1), do: "#{Name.last_name} #{street_suffix()}"
350 + defp street_name(0), do: "#{Name.first_name()} #{street_suffix()}"
351 + defp street_name(1), do: "#{Name.last_name()} #{street_suffix()}"
126 352
127 353 @doc """
128 354 Return street suffix.
355 +
356 + ## Examples
357 +
358 + iex> Faker.Address.street_suffix()
359 + "View"
360 + iex> Faker.Address.street_suffix()
361 + "Locks"
362 + iex> Faker.Address.street_suffix()
363 + "Freeway"
364 + iex> Faker.Address.street_suffix()
365 + "Lodge"
129 366 """
130 - @spec street_suffix() :: String.t
131 - sampler :street_suffix, ["Alley", "Avenue", "Branch", "Bridge", "Brook", "Brooks", "Burg", "Burgs", "Bypass", "Camp", "Canyon", "Cape", "Causeway", "Center", "Centers", "Circle", "Circles", "Cliff", "Cliffs", "Club", "Common", "Corner", "Corners", "Course", "Court", "Courts", "Cove", "Coves", "Creek", "Crescent", "Crest", "Crossing", "Crossroad", "Curve", "Dale", "Dam", "Divide", "Drive", "Drive", "Drives", "Estate", "Estates", "Expressway", "Extension", "Extensions", "Fall", "Falls", "Ferry", "Field", "Fields", "Flat", "Flats", "Ford", "Fords", "Forest", "Forge", "Forges", "Fork", "Forks", "Fort", "Freeway", "Garden", "Gardens", "Gateway", "Glen", "Glens", "Green", "Greens", "Grove", "Groves", "Harbor", "Harbors", "Haven", "Heights", "Highway", "Hill", "Hills", "Hollow", "Inlet", "Inlet", "Island", "Island", "Islands", "Islands", "Isle", "Isle", "Junction", "Junctions", "Key", "Keys", "Knoll", "Knolls", "Lake", "Lakes", "Land", "Landing", "Lane", "Light", "Lights", "Loaf", "Lock", "Locks", "Locks", "Lodge", "Lodge", "Loop", "Mall", "Manor", "Manors", "Meadow", "Meadows", "Mews", "Mill", "Mills", "Mission", "Mission", "Motorway", "Mount", "Mountain", "Mountain", "Mountains", "Mountains", "Neck", "Orchard", "Oval", "Overpass", "Park", "Parks", "Parkway", "Parkways", "Pass", "Passage", "Path", "Pike", "Pine", "Pines", "Place", "Plain", "Plains", "Plains", "Plaza", "Plaza", "Point", "Points", "Port", "Port", "Ports", "Ports", "Prairie", "Prairie", "Radial", "Ramp", "Ranch", "Rapid", "Rapids", "Rest", "Ridge", "Ridges", "River", "Road", "Road", "Roads", "Roads", "Route", "Row", "Rue", "Run", "Shoal", "Shoals", "Shore", "Shores", "Skyway", "Spring", "Springs", "Springs", "Spur", "Spurs", "Square", "Square", "Squares", "Squares", "Station", "Station", "Stravenue", "Stravenue", "Stream", "Stream", "Street", "Street", "Streets", "Summit", "Summit", "Terrace", "Throughway", "Trace", "Track", "Trafficway", "Trail", "Trail", "Tunnel", "Tunnel", "Turnpike", "Turnpike", "Underpass", "Union", "Unions", "Valley", "Valleys", "Via", "Viaduct", "View", "Views", "Village", "Village", "Villages", "Ville", "Vista", "Vista", "Walk", "Walks", "Wall", "Way", "Ways", "Well", "Wells"]
367 + @spec street_suffix() :: String.t()
368 + def street_suffix do
369 + localised_module().street_suffix
370 + end
132 371
133 372 @doc """
134 373 Return time zone.
374 +
375 + ## Examples
376 +
377 + iex> Faker.Address.time_zone()
378 + "Europe/Istanbul"
379 + iex> Faker.Address.time_zone()
380 + "Europe/Copenhagen"
381 + iex> Faker.Address.time_zone()
382 + "America/Indiana/Indianapolis"
383 + iex> Faker.Address.time_zone()
384 + "America/Guyana"
135 385 """
136 - @spec time_zone() :: String.t
137 - sampler :time_zone, ["Pacific/Midway", "Pacific/Pago_Pago", "Pacific/Honolulu", "America/Juneau", "America/Los_Angeles", "America/Tijuana", "America/Denver", "America/Phoenix", "America/Chihuahua", "America/Mazatlan", "America/Chicago", "America/Regina", "America/Mexico_City", "America/Mexico_City", "America/Monterrey", "America/Guatemala", "America/New_York", "America/Indiana/Indianapolis", "America/Bogota", "America/Lima", "America/Lima", "America/Halifax", "America/Caracas", "America/La_Paz", "America/Santiago", "America/St_Johns", "America/Sao_Paulo", "America/Argentina/Buenos_Aires", "America/Guyana", "America/Godthab", "Atlantic/South_Georgia", "Atlantic/Azores", "Atlantic/Cape_Verde", "Europe/Dublin", "Europe/London", "Europe/Lisbon", "Europe/London", "Africa/Casablanca", "Africa/Monrovia", "Etc/UTC", "Europe/Belgrade", "Europe/Bratislava", "Europe/Budapest", "Europe/Ljubljana", "Europe/Prague", "Europe/Sarajevo", "Europe/Skopje", "Europe/Warsaw", "Europe/Zagreb", "Europe/Brussels", "Europe/Copenhagen", "Europe/Madrid", "Europe/Paris", "Europe/Amsterdam", "Europe/Berlin", "Europe/Berlin", "Europe/Rome", "Europe/Stockholm", "Europe/Vienna", "Africa/Algiers", "Europe/Bucharest", "Africa/Cairo", "Europe/Helsinki", "Europe/Kiev", "Europe/Riga", "Europe/Sofia", "Europe/Tallinn", "Europe/Vilnius", "Europe/Athens", "Europe/Istanbul", "Europe/Minsk", "Asia/Jerusalem", "Africa/Harare", "Africa/Johannesburg", "Europe/Moscow", "Europe/Moscow", "Europe/Moscow", "Asia/Kuwait", "Asia/Riyadh", "Africa/Nairobi", "Asia/Baghdad", "Asia/Tehran", "Asia/Muscat", "Asia/Muscat", "Asia/Baku", "Asia/Tbilisi", "Asia/Yerevan", "Asia/Kabul", "Asia/Yekaterinburg", "Asia/Karachi", "Asia/Karachi", "Asia/Tashkent", "Asia/Kolkata", "Asia/Kolkata", "Asia/Kolkata", "Asia/Kolkata", "Asia/Kathmandu", "Asia/Dhaka", "Asia/Dhaka", "Asia/Colombo", "Asia/Almaty", "Asia/Novosibirsk", "Asia/Rangoon", "Asia/Bangkok", "Asia/Bangkok", "Asia/Jakarta", "Asia/Krasnoyarsk", "Asia/Shanghai", "Asia/Chongqing", "Asia/Hong_Kong", "Asia/Urumqi", "Asia/Kuala_Lumpur", "Asia/Singapore", "Asia/Taipei", "Australia/Perth", "Asia/Irkutsk", "Asia/Ulaanbaatar", "Asia/Seoul", "Asia/Tokyo", "Asia/Tokyo", "Asia/Tokyo", "Asia/Yakutsk", "Australia/Darwin", "Australia/Adelaide", "Australia/Melbourne", "Australia/Melbourne", "Australia/Sydney", "Australia/Brisbane", "Australia/Hobart", "Asia/Vladivostok", "Pacific/Guam", "Pacific/Port_Moresby", "Asia/Magadan", "Asia/Magadan", "Pacific/Noumea", "Pacific/Fiji", "Asia/Kamchatka", "Pacific/Majuro", "Pacific/Auckland", "Pacific/Auckland", "Pacific/Tongatapu", "Pacific/Fakaofo", "Pacific/Apia"]
386 + @spec time_zone() :: String.t()
387 + def time_zone do
388 + localised_module().time_zone
389 + end
138 390
139 391 @doc """
140 392 Return random postcode.
393 +
394 + ## Examples
395 +
396 + iex> Faker.Address.zip()
397 + "01542"
398 + iex> Faker.Address.zip()
399 + "64610"
400 + iex> Faker.Address.zip()
401 + "83297"
402 + iex> Faker.Address.zip()
403 + "05235"
141 404 """
142 - @spec zip() :: String.t
405 + @spec zip() :: String.t()
143 406 defdelegate zip, to: __MODULE__, as: :zip_code
144 407
145 408 @doc """
146 409 Return random postcode.
410 +
411 + ## Examples
412 +
413 + iex> Faker.Address.zip_code()
414 + "01542"
415 + iex> Faker.Address.zip_code()
416 + "64610"
417 + iex> Faker.Address.zip_code()
418 + "83297"
419 + iex> Faker.Address.zip_code()
420 + "05235"
147 421 """
148 - @spec zip_code() :: String.t
422 + @spec zip_code() :: String.t()
149 423 def zip_code do
150 - ["#####", "#####-####"]
151 - |> Enum.at(Faker.random_between(0, 1))
152 - |> Faker.format
424 + localised_module().zip_code
153 425 end
426 +
427 + defp localised_module, do: Module.concat(__MODULE__, Faker.mlocale())
154 428 end
  @@ -0,0 +1,1291 @@
1 + defmodule Faker.Address.En do
2 + import Faker, only: [sampler: 2]
3 +
4 + alias Faker.Name
5 +
6 + @moduledoc """
7 + Functions for generating addresses in Spanish
8 + """
9 +
10 + @doc """
11 + Return random building number.
12 +
13 + ## Examples
14 +
15 + iex> Faker.Address.En.building_number()
16 + "15426"
17 + iex> Faker.Address.En.building_number()
18 + "6"
19 + iex> Faker.Address.En.building_number()
20 + "0832"
21 + iex> Faker.Address.En.building_number()
22 + "7"
23 + """
24 + @spec building_number() :: String.t()
25 + def building_number do
26 + ["#####", "####", "###", "##", "#"]
27 + |> Enum.at(Faker.random_between(0, 4))
28 + |> Faker.format()
29 + end
30 +
31 + @doc """
32 + Return city name.
33 +
34 + ## Examples
35 +
36 + iex> Faker.Address.En.city()
37 + "Elizabeth"
38 + iex> Faker.Address.En.city()
39 + "Rolfson"
40 + iex> Faker.Address.En.city()
41 + "West Conor"
42 + iex> Faker.Address.En.city()
43 + "Hardy"
44 + """
45 + @spec city() :: String.t()
46 + def city do
47 + city(Faker.random_between(0, 3))
48 + end
49 +
50 + defp city(0), do: "#{city_prefix()} #{Name.first_name()}"
51 + defp city(1), do: "#{city_prefix()} #{Name.first_name()}"
52 + defp city(2), do: "#{Name.first_name()}"
53 + defp city(3), do: "#{Name.last_name()}"
54 +
55 + @doc """
56 + Return city prefix.
57 +
58 + ## Examples
59 +
60 + iex> Faker.Address.En.city_prefix()
61 + "Port"
62 + iex> Faker.Address.En.city_prefix()
63 + "West"
64 + iex> Faker.Address.En.city_prefix()
65 + "North"
66 + iex> Faker.Address.En.city_prefix()
67 + "Lake"
68 + """
69 + @spec city_prefix() :: String.t()
70 + sampler(:city_prefix, [
71 + "North",
72 + "East",
73 + "West",
74 + "South",
75 + "New",
76 + "Lake",
77 + "Port"
78 + ])
79 +
80 + @doc """
81 + Return city prefix.
82 +
83 + ## Examples
84 +
85 + iex> Faker.Address.En.city_suffix()
86 + "burgh"
87 + iex> Faker.Address.En.city_suffix()
88 + "mouth"
89 + iex> Faker.Address.En.city_suffix()
90 + "burgh"
91 + iex> Faker.Address.En.city_suffix()
92 + "view"
93 + """
94 + @spec city_suffix() :: String.t()
95 + sampler(:city_suffix, [
96 + "town",
97 + "ton",
98 + "land",
99 + "ville",
100 + "berg",
101 + "burgh",
102 + "borough",
103 + "bury",
104 + "view",
105 + "port",
106 + "mouth",
107 + "stad",
108 + "furt",
109 + "chester",
110 + "mouth",
111 + "fort",
112 + "haven",
113 + "side",
114 + "shire"
115 + ])
116 +
117 + @doc """
118 + Return country.
119 +
120 + ## Examples
121 +
122 + iex> Faker.Address.En.country()
123 + "China"
124 + iex> Faker.Address.En.country()
125 + "Macedonia"
126 + iex> Faker.Address.En.country()
127 + "China"
128 + iex> Faker.Address.En.country()
129 + "Venezuela"
130 + """
131 + @spec country() :: String.t()
132 + sampler(:country, [
133 + "Afghanistan",
134 + "Albania",
135 + "Algeria",
136 + "American Samoa",
137 + "Andorra",
138 + "Angola",
139 + "Anguilla",
140 + "Antarctica (the territory South of 60 deg S)",
141 + "Antigua and Barbuda",
142 + "Argentina",
143 + "Armenia",
144 + "Aruba",
145 + "Australia",
146 + "Austria",
147 + "Azerbaijan",
148 + "Bahamas",
149 + "Bahrain",
150 + "Bangladesh",
151 + "Barbados",
152 + "Belarus",
153 + "Belgium",
154 + "Belize",
155 + "Benin",
156 + "Bermuda",
157 + "Bhutan",
158 + "Bolivia",
159 + "Bosnia and Herzegovina",
160 + "Botswana",
161 + "Bouvet Island (Bouvetoya)",
162 + "Brazil",
163 + "British Indian Ocean Territory (Chagos Archipelago)",
164 + "Brunei Darussalam",
165 + "Bulgaria",
166 + "Burkina Faso",
167 + "Burundi",
168 + "Cambodia",
169 + "Cameroon",
170 + "Canada",
171 + "Cape Verde",
172 + "Cayman Islands",
173 + "Central African Republic",
174 + "Chad",
175 + "Chile",
176 + "China",
177 + "Christmas Island",
178 + "Cocos (Keeling) Islands",
179 + "Colombia",
180 + "Comoros",
181 + "Congo",
182 + "Congo",
183 + "Cook Islands",
184 + "Costa Rica",
185 + "Cote d'Ivoire",
186 + "Croatia",
187 + "Cuba",
188 + "Cyprus",
189 + "Czech Republic",
190 + "Denmark",
191 + "Djibouti",
192 + "Dominica",
193 + "Dominican Republic",
194 + "Ecuador",
195 + "Egypt",
196 + "El Salvador",
197 + "Equatorial Guinea",
198 + "Eritrea",
199 + "Estonia",
200 + "Ethiopia",
201 + "Faroe Islands",
202 + "Falkland Islands (Malvinas)",
203 + "Fiji",
204 + "Finland",
205 + "France",
206 + "French Guiana",
207 + "French Polynesia",
208 + "French Southern Territories",
209 + "Gabon",
210 + "Gambia",
211 + "Georgia",
212 + "Germany",
213 + "Ghana",
214 + "Gibraltar",
215 + "Greece",
216 + "Greenland",
217 + "Grenada",
218 + "Guadeloupe",
219 + "Guam",
220 + "Guatemala",
221 + "Guernsey",
222 + "Guinea",
223 + "Guinea-Bissau",
224 + "Guyana",
225 + "Haiti",
226 + "Heard Island and McDonald Islands",
227 + "Holy See (Vatican City State)",
228 + "Honduras",
229 + "Hong Kong",
230 + "Hungary",
231 + "Iceland",
232 + "India",
233 + "Indonesia",
234 + "Iran",
235 + "Iraq",
236 + "Ireland",
237 + "Isle of Man",
238 + "Israel",
239 + "Italy",
240 + "Jamaica",
241 + "Japan",
242 + "Jersey",
243 + "Jordan",
244 + "Kazakhstan",
245 + "Kenya",
246 + "Kiribati",
247 + "Democratic People's Republic of Korea",
248 + "Republic of Korea",
249 + "Kuwait",
250 + "Kyrgyz Republic",
251 + "Lao People's Democratic Republic",
252 + "Latvia",
253 + "Lebanon",
254 + "Lesotho",
255 + "Liberia",
256 + "Libyan Arab Jamahiriya",
257 + "Liechtenstein",
258 + "Lithuania",
259 + "Luxembourg",
260 + "Macao",
261 + "Macedonia",
262 + "Madagascar",
263 + "Malawi",
264 + "Malaysia",
265 + "Maldives",
266 + "Mali",
267 + "Malta",
268 + "Marshall Islands",
269 + "Martinique",
270 + "Mauritania",
271 + "Mauritius",
272 + "Mayotte",
273 + "Mexico",
274 + "Micronesia",
275 + "Moldova",
276 + "Monaco",
277 + "Mongolia",
278 + "Montenegro",
279 + "Montserrat",
280 + "Morocco",
281 + "Mozambique",
282 + "Myanmar",
283 + "Namibia",
284 + "Nauru",
285 + "Nepal",
286 + "Netherlands Antilles",
287 + "Netherlands",
288 + "New Caledonia",
289 + "New Zealand",
290 + "Nicaragua",
291 + "Niger",
292 + "Nigeria",
293 + "Niue",
294 + "Norfolk Island",
295 + "Northern Mariana Islands",
296 + "Norway",
297 + "Oman",
298 + "Pakistan",
299 + "Palau",
300 + "Palestinian Territory",
301 + "Panama",
302 + "Papua New Guinea",
303 + "Paraguay",
304 + "Peru",
305 + "Philippines",
306 + "Pitcairn Islands",
307 + "Poland",
308 + "Portugal",
309 + "Puerto Rico",
310 + "Qatar",
311 + "Reunion",
312 + "Romania",
313 + "Russian Federation",
314 + "Rwanda",
315 + "Saint Barthelemy",
316 + "Saint Helena",
317 + "Saint Kitts and Nevis",
318 + "Saint Lucia",
319 + "Saint Martin",
320 + "Saint Pierre and Miquelon",
321 + "Saint Vincent and the Grenadines",
322 + "Samoa",
323 + "San Marino",
324 + "Sao Tome and Principe",
325 + "Saudi Arabia",
326 + "Senegal",
327 + "Serbia",
328 + "Seychelles",
329 + "Sierra Leone",
330 + "Singapore",
331 + "Slovakia (Slovak Republic)",
332 + "Slovenia",
333 + "Solomon Islands",
334 + "Somalia",
335 + "South Africa",
336 + "South Georgia and the South Sandwich Islands",
337 + "Spain",
338 + "Sri Lanka",
339 + "Sudan",
340 + "Suriname",
341 + "Svalbard & Jan Mayen Islands",
342 + "Swaziland",
343 + "Sweden",
344 + "Switzerland",
345 + "Syrian Arab Republic",
346 + "Taiwan",
347 + "Tajikistan",
348 + "Tanzania",
349 + "Thailand",
350 + "Timor-Leste",
351 + "Togo",
352 + "Tokelau",
353 + "Tonga",
354 + "Trinidad and Tobago",
355 + "Tunisia",
356 + "Turkey",
357 + "Turkmenistan",
358 + "Turks and Caicos Islands",
359 + "Tuvalu",
360 + "Uganda",
361 + "Ukraine",
362 + "United Arab Emirates",
363 + "United Kingdom",
364 + "United States of America",
365 + "United States Minor Outlying Islands",
366 + "Uruguay",
367 + "Uzbekistan",
368 + "Vanuatu",
369 + "Venezuela",
370 + "Vietnam",
371 + "'Virgin Islands",
372 + "British'",
373 + "'Virgin Islands",
374 + "U.S.'",
375 + "Wallis and Futuna",
376 + "Western Sahara",
377 + "Yemen",
378 + "Zambia",
379 + "Zimbabwe"
380 + ])
381 +
382 + @doc """
383 + Return country code.
384 +
385 + ## Examples
386 +
387 + iex> Faker.Address.En.country_code()
388 + "IT"
389 + iex> Faker.Address.En.country_code()
390 + "MR"
391 + iex> Faker.Address.En.country_code()
392 + "GM"
393 + iex> Faker.Address.En.country_code()
394 + "CX"
395 + """
396 + @spec country_code() :: String.t()
397 + sampler(:country_code, [
398 + "AD",
399 + "AE",
400 + "AF",
401 + "AG",
402 + "AI",
403 + "AL",
404 + "AM",
405 + "AO",
406 + "AQ",
407 + "AR",
408 + "AS",
409 + "AT",
410 + "AU",
411 + "AW",
412 + "AX",
413 + "AZ",
414 + "BA",
415 + "BB",
416 + "BD",
417 + "BE",
418 + "BF",
419 + "BG",
420 + "BH",
421 + "BI",
422 + "BJ",
423 + "BL",
424 + "BM",
425 + "BN",
426 + "BO",
427 + "BQ",
428 + "BQ",
429 + "BR",
430 + "BS",
431 + "BT",
432 + "BV",
433 + "BW",
434 + "BY",
435 + "BZ",
436 + "CA",
437 + "CC",
438 + "CD",
439 + "CF",
440 + "CG",
441 + "CH",
442 + "CI",
443 + "CK",
444 + "CL",
445 + "CM",
446 + "CN",
447 + "CO",
448 + "CR",
449 + "CU",
450 + "CV",
451 + "CW",
452 + "CX",
453 + "CY",
454 + "CZ",
455 + "DE",
456 + "DJ",
457 + "DK",
458 + "DM",
459 + "DO",
460 + "DZ",
461 + "EC",
462 + "EE",
463 + "EG",
464 + "EH",
465 + "ER",
466 + "ES",
467 + "ET",
468 + "FI",
469 + "FJ",
470 + "FK",
471 + "FM",
472 + "FO",
473 + "FR",
474 + "GA",
475 + "GB",
476 + "GD",
477 + "GE",
478 + "GF",
479 + "GG",
480 + "GH",
481 + "GI",
482 + "GL",
483 + "GM",
484 + "GN",
485 + "GP",
486 + "GQ",
487 + "GR",
488 + "GS",
489 + "GT",
490 + "GU",
491 + "GW",
492 + "GY",
493 + "HK",
494 + "HM",
495 + "HN",
496 + "HR",
497 + "HT",
498 + "HU",
499 + "ID",
500 + "IE",
501 + "IL",
502 + "IM",
503 + "IN",
504 + "IO",
505 + "IQ",
506 + "IR",
507 + "IS",
508 + "IT",
509 + "JE",
510 + "JM",
511 + "JO",
512 + "JP",
513 + "KE",
514 + "KG",
515 + "KH",
516 + "KI",
517 + "KM",
518 + "KN",
519 + "KP",
520 + "KR",
521 + "KW",
522 + "KY",
523 + "KZ",
524 + "LA",
525 + "LB",
526 + "LC",
527 + "LI",
528 + "LK",
529 + "LR",
530 + "LS",
531 + "LT",
532 + "LU",
533 + "LV",
534 + "LY",
535 + "MA",
536 + "MC",
537 + "MD",
538 + "ME",
539 + "MF",
540 + "MG",
541 + "MH",
542 + "MK",
543 + "ML",
544 + "MM",
545 + "MN",
546 + "MO",
547 + "MP",
548 + "MQ",
549 + "MR",
550 + "MS",
551 + "MT",
552 + "MU",
553 + "MV",
554 + "MW",
555 + "MX",
556 + "MY",
557 + "MZ",
558 + "NA",
559 + "NC",
560 + "NE",
561 + "NF",
562 + "NG",
563 + "NI",
564 + "NL",
565 + "NO",
566 + "NP",
567 + "NR",
568 + "NU",
569 + "NZ",
570 + "OM",
571 + "PA",
572 + "PE",
573 + "PF",
574 + "PG",
575 + "PH",
576 + "PK",
577 + "PL",
578 + "PM",
579 + "PN",
580 + "PR",
581 + "PS",
582 + "PT",
583 + "PW",
584 + "PY",
585 + "QA",
586 + "RE",
587 + "RO",
588 + "RS",
589 + "RU",
590 + "RW",
591 + "SA",
592 + "SB",
593 + "SC",
594 + "SD",
595 + "SE",
596 + "SG",
597 + "SH",
598 + "SI",
599 + "SJ",
600 + "SK",
601 + "SL",
602 + "SM",
603 + "SN",
604 + "SO",
605 + "SR",
606 + "SS",
607 + "ST",
608 + "SV",
609 + "SX",
610 + "SY",
611 + "SZ",
612 + "TC",
613 + "TD",
614 + "TF",
615 + "TG",
616 + "TH",
617 + "TJ",
618 + "TK",
619 + "TL",
620 + "TM",
621 + "TN",
622 + "TO",
623 + "TR",
624 + "TT",
625 + "TV",
626 + "TW",
627 + "TZ",
628 + "UA",
629 + "UG",
630 + "UM",
631 + "US",
632 + "UY",
633 + "UZ",
634 + "VA",
635 + "VC",
636 + "VE",
637 + "VG",
638 + "VI",
639 + "VN",
640 + "VU",
641 + "WF",
642 + "WS",
643 + "YE",
644 + "YT",
645 + "ZA",
646 + "ZM",
647 + "ZW"
648 + ])
649 +
650 + @doc """
651 + Return random secondary address.
652 +
653 + ## Examples
654 +
655 + iex> Faker.Address.En.secondary_address()
656 + "Apt. 154"
657 + iex> Faker.Address.En.secondary_address()
658 + "Apt. 646"
659 + iex> Faker.Address.En.secondary_address()
660 + "Suite 083"
661 + iex> Faker.Address.En.secondary_address()
662 + "Apt. 970"
663 + """
664 + @spec secondary_address() :: String.t()
665 + def secondary_address do
666 + ["Apt. ###", "Suite ###"]
667 + |> Enum.at(Faker.random_between(0, 1))
668 + |> Faker.format()
669 + end
670 +
671 + @doc """
672 + Return state.
673 +
674 + ## Examples
675 +
676 + iex> Faker.Address.En.state()
677 + "Hawaii"
678 + iex> Faker.Address.En.state()
679 + "Alaska"
680 + iex> Faker.Address.En.state()
681 + "Oklahoma"
682 + iex> Faker.Address.En.state()
683 + "California"
684 + """
685 + @spec state() :: String.t()
686 + sampler(:state, [
687 + "Alabama",
688 + "Alaska",
689 + "Arizona",
690 + "Arkansas",
691 + "California",
692 + "Colorado",
693 + "Connecticut",
694 + "Delaware",
695 + "Florida",
696 + "Georgia",
697 + "Hawaii",
698 + "Idaho",
699 + "Illinois",
700 + "Indiana",
701 + "Iowa",
702 + "Kansas",
703 + "Kentucky",
704 + "Louisiana",
705 + "Maine",
706 + "Maryland",
707 + "Massachusetts",
708 + "Michigan",
709 + "Minnesota",
710 + "Mississippi",
711 + "Missouri",
712 + "Montana",
713 + "Nebraska",
714 + "Nevada",
715 + "New Hampshire",
716 + "New Jersey",
717 + "New Mexico",
718 + "New York",
719 + "North Carolina",
720 + "North Dakota",
721 + "Ohio",
722 + "Oklahoma",
723 + "Oregon",
724 + "Pennsylvania",
725 + "Rhode Island",
726 + "South Carolina",
727 + "South Dakota",
728 + "Tennessee",
729 + "Texas",
730 + "Utah",
731 + "Vermont",
732 + "Virginia",
733 + "Washington",
734 + "West Virginia",
735 + "Wisconsin",
736 + "Wyoming"
737 + ])
738 +
739 + @doc """
740 + Return state abbr.
741 +
742 + ## Examples
743 +
744 + iex> Faker.Address.En.state_abbr()
745 + "HI"
746 + iex> Faker.Address.En.state_abbr()
747 + "AK"
748 + iex> Faker.Address.En.state_abbr()
749 + "OK"
750 + iex> Faker.Address.En.state_abbr()
751 + "CA"
752 + """
753 + @spec state_abbr() :: String.t()
754 + sampler(:state_abbr, [
755 + "AL",
756 + "AK",
757 + "AZ",
758 + "AR",
759 + "CA",
760 + "CO",
761 + "CT",
762 + "DE",
763 + "FL",
764 + "GA",
765 + "HI",
766 + "ID",
767 + "IL",
768 + "IN",
769 + "IA",
770 + "KS",
771 + "KY",
772 + "LA",
773 + "ME",
774 + "MD",
775 + "MA",
776 + "MI",
777 + "MN",
778 + "MS",
779 + "MO",
780 + "MT",
781 + "NE",
782 + "NV",
783 + "NH",
784 + "NJ",
785 + "NM",
786 + "NY",
787 + "NC",
788 + "ND",
789 + "OH",
790 + "OK",
791 + "OR",
792 + "PA",
793 + "RI",
794 + "SC",
795 + "SD",
796 + "TN",
797 + "TX",
798 + "UT",
799 + "VT",
800 + "VA",
801 + "WA",
802 + "WV",
803 + "WI",
804 + "WY"
805 + ])
806 +
807 + @doc """
808 + Return street address.
809 +
810 + ## Examples
811 +
812 + iex> Faker.Address.En.street_address()
813 + "Elizabeth Freeway 2"
814 + iex> Faker.Address.En.street_address()
815 + "Conor Motorway 0832"
816 + iex> Faker.Address.En.street_address()
817 + "Rau Crest 23570"
818 + iex> Faker.Address.En.street_address()
819 + "Schimmel Field 32097"
820 + """
821 + @spec street_address() :: String.t()
822 + def street_address do
823 + "#{street_name()} #{building_number()}"
824 + end
825 +
826 + @doc """
827 + Return `street_address/0` or if argument is `true` adds `secondary_address/0`.
828 +
829 + ## Examples
830 +
831 + iex> Faker.Address.En.street_address(true)
832 + "Elizabeth Freeway 2 Apt. 461"
833 + iex> Faker.Address.En.street_address(false)
834 + "Bianka Heights 970"
835 + iex> Faker.Address.En.street_address(true)
836 + "Crooks Thomas Spur 020 Suite 032"
837 + iex> Faker.Address.En.street_address(false)
838 + "Johann Gardens 37"
839 + """
840 + @spec street_address(true | any) :: String.t()
841 + def street_address(true), do: street_address() <> " " <> secondary_address()
842 + def street_address(_), do: street_address()
843 +
844 + @doc """
845 + Return street name.
846 +
847 + ## Examples
848 +
849 + iex> Faker.Address.En.street_name()
850 + "Elizabeth Freeway"
851 + iex> Faker.Address.En.street_name()
852 + "Sipes Trycia Glen"
853 + iex> Faker.Address.En.street_name()
854 + "Schiller Delphine Points"
855 + iex> Faker.Address.En.street_name()
856 + "Murphy Shore"
857 + """
858 + @spec street_name() :: String.t()
859 + def street_name do
860 + street_name(Faker.random_between(0, 2))
861 + end
862 +
863 + defp street_name(0), do: "#{Name.first_name()} #{street_suffix()}"
864 + defp street_name(1), do: "#{Name.last_name()} #{street_suffix()}"
865 + defp street_name(2), do: "#{Name.last_name()} #{Name.first_name()} #{street_suffix()}"
866 +
867 + @doc """
868 + Return street suffix.
869 +
870 + ## Examples
871 +
872 + iex> Faker.Address.En.street_suffix()
873 + "View"
874 + iex> Faker.Address.En.street_suffix()
875 + "Locks"
876 + iex> Faker.Address.En.street_suffix()
877 + "Freeway"
878 + iex> Faker.Address.En.street_suffix()
879 + "Lodge"
880 + """
881 + @spec street_suffix() :: String.t()
882 + sampler(:street_suffix, [
883 + "Alley",
884 + "Avenue",
885 + "Branch",
886 + "Bridge",
887 + "Brook",
888 + "Brooks",
889 + "Burg",
890 + "Burgs",
891 + "Bypass",
892 + "Camp",
893 + "Canyon",
894 + "Cape",
895 + "Causeway",
896 + "Center",
897 + "Centers",
898 + "Circle",
899 + "Circles",
900 + "Cliff",
901 + "Cliffs",
902 + "Club",
903 + "Common",
904 + "Corner",
905 + "Corners",
906 + "Course",
907 + "Court",
908 + "Courts",
909 + "Cove",
910 + "Coves",
911 + "Creek",
912 + "Crescent",
913 + "Crest",
914 + "Crossing",
915 + "Crossroad",
916 + "Curve",
917 + "Dale",
918 + "Dam",
919 + "Divide",
920 + "Drive",
921 + "Drive",
922 + "Drives",
923 + "Estate",
924 + "Estates",
925 + "Expressway",
926 + "Extension",
927 + "Extensions",
928 + "Fall",
929 + "Falls",
930 + "Ferry",
931 + "Field",
932 + "Fields",
933 + "Flat",
934 + "Flats",
935 + "Ford",
936 + "Fords",
937 + "Forest",
938 + "Forge",
939 + "Forges",
940 + "Fork",
941 + "Forks",
942 + "Fort",
943 + "Freeway",
944 + "Garden",
945 + "Gardens",
946 + "Gateway",
947 + "Glen",
948 + "Glens",
949 + "Green",
950 + "Greens",
951 + "Grove",
952 + "Groves",
953 + "Harbor",
954 + "Harbors",
955 + "Haven",
956 + "Heights",
957 + "Highway",
958 + "Hill",
959 + "Hills",
960 + "Hollow",
961 + "Inlet",
962 + "Inlet",
963 + "Island",
964 + "Island",
965 + "Islands",
966 + "Islands",
967 + "Isle",
968 + "Isle",
969 + "Junction",
970 + "Junctions",
971 + "Key",
972 + "Keys",
973 + "Knoll",
974 + "Knolls",
975 + "Lake",
976 + "Lakes",
977 + "Land",
978 + "Landing",
979 + "Lane",
980 + "Light",
981 + "Lights",
982 + "Loaf",
983 + "Lock",
984 + "Locks",
985 + "Locks",
986 + "Lodge",
987 + "Lodge",
988 + "Loop",
989 + "Mall",
990 + "Manor",
991 + "Manors",
992 + "Meadow",
993 + "Meadows",
994 + "Mews",
995 + "Mill",
996 + "Mills",
997 + "Mission",
998 + "Mission",
999 + "Motorway",
1000 + "Mount",
1001 + "Mountain",
1002 + "Mountain",
1003 + "Mountains",
1004 + "Mountains",
1005 + "Neck",
1006 + "Orchard",
1007 + "Oval",
1008 + "Overpass",
1009 + "Park",
1010 + "Parks",
1011 + "Parkway",
1012 + "Parkways",
1013 + "Pass",
1014 + "Passage",
1015 + "Path",
1016 + "Pike",
1017 + "Pine",
1018 + "Pines",
1019 + "Place",
1020 + "Plain",
1021 + "Plains",
1022 + "Plains",
1023 + "Plaza",
1024 + "Plaza",
1025 + "Point",
1026 + "Points",
1027 + "Port",
1028 + "Port",
1029 + "Ports",
1030 + "Ports",
1031 + "Prairie",
1032 + "Prairie",
1033 + "Radial",
1034 + "Ramp",
1035 + "Ranch",
1036 + "Rapid",
1037 + "Rapids",
1038 + "Rest",
1039 + "Ridge",
1040 + "Ridges",
1041 + "River",
1042 + "Road",
1043 + "Road",
1044 + "Roads",
1045 + "Roads",
1046 + "Route",
1047 + "Row",
1048 + "Rue",
1049 + "Run",
1050 + "Shoal",
1051 + "Shoals",
1052 + "Shore",
1053 + "Shores",
1054 + "Skyway",
1055 + "Spring",
1056 + "Springs",
1057 + "Springs",
1058 + "Spur",
1059 + "Spurs",
1060 + "Square",
1061 + "Square",
1062 + "Squares",
1063 + "Squares",
1064 + "Station",
1065 + "Station",
1066 + "Stravenue",
1067 + "Stravenue",
1068 + "Stream",
1069 + "Stream",
1070 + "Street",
1071 + "Street",
1072 + "Streets",
1073 + "Summit",
1074 + "Summit",
1075 + "Terrace",
1076 + "Throughway",
1077 + "Trace",
1078 + "Track",
1079 + "Trafficway",
1080 + "Trail",
1081 + "Trail",
1082 + "Tunnel",
1083 + "Tunnel",
1084 + "Turnpike",
1085 + "Turnpike",
1086 + "Underpass",
1087 + "Union",
1088 + "Unions",
1089 + "Valley",
1090 + "Valleys",
1091 + "Via",
1092 + "Viaduct",
1093 + "View",
1094 + "Views",
1095 + "Village",
1096 + "Village",
1097 + "Villages",
1098 + "Ville",
1099 + "Vista",
1100 + "Vista",
1101 + "Walk",
1102 + "Walks",
1103 + "Wall",
1104 + "Way",
1105 + "Ways",
1106 + "Well",
1107 + "Wells"
1108 + ])
1109 +
1110 + @doc """
1111 + Return time zone.
1112 +
1113 + ## Examples
1114 +
1115 + iex> Faker.Address.En.time_zone()
1116 + "Europe/Istanbul"
1117 + iex> Faker.Address.En.time_zone()
1118 + "Europe/Copenhagen"
1119 + iex> Faker.Address.En.time_zone()
1120 + "America/Indiana/Indianapolis"
1121 + iex> Faker.Address.En.time_zone()
1122 + "America/Guyana"
1123 + """
1124 + @spec time_zone() :: String.t()
1125 + sampler(:time_zone, [
1126 + "Pacific/Midway",
1127 + "Pacific/Pago_Pago",
1128 + "Pacific/Honolulu",
1129 + "America/Juneau",
1130 + "America/Los_Angeles",
1131 + "America/Tijuana",
1132 + "America/Denver",
1133 + "America/Phoenix",
1134 + "America/Chihuahua",
1135 + "America/Mazatlan",
1136 + "America/Chicago",
1137 + "America/Regina",
1138 + "America/Mexico_City",
1139 + "America/Mexico_City",
1140 + "America/Monterrey",
1141 + "America/Guatemala",
1142 + "America/New_York",
1143 + "America/Indiana/Indianapolis",
1144 + "America/Bogota",
1145 + "America/Lima",
1146 + "America/Lima",
1147 + "America/Halifax",
1148 + "America/Caracas",
1149 + "America/La_Paz",
1150 + "America/Santiago",
1151 + "America/St_Johns",
1152 + "America/Sao_Paulo",
1153 + "America/Argentina/Buenos_Aires",
1154 + "America/Guyana",
1155 + "America/Godthab",
1156 + "Atlantic/South_Georgia",
1157 + "Atlantic/Azores",
1158 + "Atlantic/Cape_Verde",
1159 + "Europe/Dublin",
1160 + "Europe/London",
1161 + "Europe/Lisbon",
1162 + "Europe/London",
1163 + "Africa/Casablanca",
1164 + "Africa/Monrovia",
1165 + "Etc/UTC",
1166 + "Europe/Belgrade",
1167 + "Europe/Bratislava",
1168 + "Europe/Budapest",
1169 + "Europe/Ljubljana",
1170 + "Europe/Prague",
1171 + "Europe/Sarajevo",
1172 + "Europe/Skopje",
1173 + "Europe/Warsaw",
1174 + "Europe/Zagreb",
1175 + "Europe/Brussels",
1176 + "Europe/Copenhagen",
1177 + "Europe/Madrid",
1178 + "Europe/Paris",
1179 + "Europe/Amsterdam",
1180 + "Europe/Berlin",
1181 + "Europe/Berlin",
1182 + "Europe/Rome",
1183 + "Europe/Stockholm",
1184 + "Europe/Vienna",
1185 + "Africa/Algiers",
1186 + "Europe/Bucharest",
1187 + "Africa/Cairo",
1188 + "Europe/Helsinki",
1189 + "Europe/Kiev",
1190 + "Europe/Riga",
1191 + "Europe/Sofia",
1192 + "Europe/Tallinn",
1193 + "Europe/Vilnius",
1194 + "Europe/Athens",
1195 + "Europe/Istanbul",
1196 + "Europe/Minsk",
1197 + "Asia/Jerusalem",
1198 + "Africa/Harare",
1199 + "Africa/Johannesburg",
1200 + "Europe/Moscow",
1201 + "Europe/Moscow",
1202 + "Europe/Moscow",
1203 + "Asia/Kuwait",
1204 + "Asia/Riyadh",
1205 + "Africa/Nairobi",
1206 + "Asia/Baghdad",
1207 + "Asia/Tehran",
1208 + "Asia/Muscat",
1209 + "Asia/Muscat",
1210 + "Asia/Baku",
1211 + "Asia/Tbilisi",
1212 + "Asia/Yerevan",
1213 + "Asia/Kabul",
1214 + "Asia/Yekaterinburg",
1215 + "Asia/Karachi",
1216 + "Asia/Karachi",
1217 + "Asia/Tashkent",
1218 + "Asia/Kolkata",
1219 + "Asia/Kolkata",
1220 + "Asia/Kolkata",
1221 + "Asia/Kolkata",
1222 + "Asia/Kathmandu",
1223 + "Asia/Dhaka",
1224 + "Asia/Dhaka",
1225 + "Asia/Colombo",
1226 + "Asia/Almaty",
1227 + "Asia/Novosibirsk",
1228 + "Asia/Rangoon",
1229 + "Asia/Bangkok",
1230 + "Asia/Bangkok",
1231 + "Asia/Jakarta",
1232 + "Asia/Krasnoyarsk",
1233 + "Asia/Shanghai",
1234 + "Asia/Chongqing",
1235 + "Asia/Hong_Kong",
1236 + "Asia/Urumqi",
1237 + "Asia/Kuala_Lumpur",
1238 + "Asia/Singapore",
1239 + "Asia/Taipei",
1240 + "Australia/Perth",
1241 + "Asia/Irkutsk",
1242 + "Asia/Ulaanbaatar",
1243 + "Asia/Seoul",
1244 + "Asia/Tokyo",
1245 + "Asia/Tokyo",
1246 + "Asia/Tokyo",
1247 + "Asia/Yakutsk",
1248 + "Australia/Darwin",
1249 + "Australia/Adelaide",
1250 + "Australia/Melbourne",
1251 + "Australia/Melbourne",
1252 + "Australia/Sydney",
1253 + "Australia/Brisbane",
1254 + "Australia/Hobart",
1255 + "Asia/Vladivostok",
1256 + "Pacific/Guam",
1257 + "Pacific/Port_Moresby",
1258 + "Asia/Magadan",
1259 + "Asia/Magadan",
1260 + "Pacific/Noumea",
1261 + "Pacific/Fiji",
1262 + "Asia/Kamchatka",
1263 + "Pacific/Majuro",
1264 + "Pacific/Auckland",
1265 + "Pacific/Auckland",
1266 + "Pacific/Tongatapu",
1267 + "Pacific/Fakaofo",
1268 + "Pacific/Apia"
1269 + ])
1270 +
1271 + @doc """
1272 + Return random postcode.
1273 +
1274 + ## Examples
1275 +
1276 + iex> Faker.Address.En.zip_code()
1277 + "01542"
1278 + iex> Faker.Address.En.zip_code()
1279 + "64610"
1280 + iex> Faker.Address.En.zip_code()
1281 + "83297"
1282 + iex> Faker.Address.En.zip_code()
1283 + "05235"
1284 + """
1285 + @spec zip_code() :: String.t()
1286 + def zip_code do
1287 + ["#####", "#####-####"]
1288 + |> Enum.at(0)
1289 + |> Faker.format()
1290 + end
1291 + end
  @@ -0,0 +1,811 @@
1 + defmodule Faker.Address.Es do
2 + import Faker, only: [sampler: 2]
3 +
4 + alias Faker.Name
5 +
6 + @moduledoc """
7 + Functions for generating addresses in Spanish
8 + """
9 +
10 + @doc """
11 + Return random building number.
12 +
13 + ## Examples
14 +
15 + iex> Faker.Address.Es.building_number()
16 + "s/n."
17 + iex> Faker.Address.Es.building_number()
18 + "5"
19 + iex> Faker.Address.Es.building_number()
20 + "26"
21 + iex> Faker.Address.Es.building_number()
22 + "61"
23 + """
24 + @spec building_number() :: String.t()
25 + def building_number do
26 + ["s/n.", "#", "##", "#", "##"]
27 + |> Enum.at(Faker.random_between(0, 4))
28 + |> Faker.format()
29 + end
30 +
31 + @doc """
32 + Return city name.
33 +
34 + ## Examples
35 +
36 + iex> Faker.Address.Es.city()
37 + "Elizabeth"
38 + iex> Faker.Address.Es.city()
39 + "Rolfson"
40 + iex> Faker.Address.Es.city()
41 + "Burgos Conor"
42 + iex> Faker.Address.Es.city()
43 + "Hardy"
44 + """
45 + @spec city() :: String.t()
46 + def city do
47 + city(Faker.random_between(0, 3))
48 + end
49 +
50 + defp city(0), do: "#{city_prefix()} #{Name.first_name()}"
51 + defp city(1), do: "#{city_prefix()} #{Name.first_name()}"
52 + defp city(2), do: "#{Name.first_name()}"
53 + defp city(3), do: "#{Name.last_name()}"
54 +
55 + @doc """
56 + Return city prefix.
57 +
58 + ## Examples
59 +
60 + iex> Faker.Address.Es.city_prefix()
61 + "Vitoria"
62 + iex> Faker.Address.Es.city_prefix()
63 + "Oviedo"
64 + iex> Faker.Address.Es.city_prefix()
65 + "Talavera de la Reina"
66 + iex> Faker.Address.Es.city_prefix()
67 + "Cáceres"
68 + """
69 + @spec city_prefix() :: String.t()
70 + sampler(:city_prefix, [
71 + "Parla",
72 + "Telde",
73 + "Baracaldo",
74 + "San Fernando",
75 + "Torrevieja",
76 + "Lugo",
77 + "Santiago de Compostela",
78 + "Gerona",
79 + "Cáceres",
80 + "Lorca",
81 + "Coslada",
82 + "Talavera de la Reina",
83 + "El Puerto de Santa María",
84 + "Cornellá de Llobregat",
85 + "Avilés",
86 + "Palencia",
87 + "Gecho",
88 + "Orihuela",
89 + "Pontevedra",
90 + "Pozuelo de Alarcón",
91 + "Toledo",
92 + "El Ejido",
93 + "Guadalajara",
94 + "Gandía",
95 + "Ceuta",
96 + "Ferrol",
97 + "Chiclana de la Frontera",
98 + "Manresa",
99 + "Roquetas de Mar",
100 + "Ciudad Real",
101 + "Rubí",
102 + "Benidorm",
103 + "San Sebastían de los Reyes",
104 + "Ponferrada",
105 + "Zamora",
106 + "Alcalá de Guadaira",
107 + "Fuengirola",
108 + "Mijas",
109 + "Sanlúcar de Barrameda",
110 + "La Línea de la Concepción",
111 + "Majadahonda",
112 + "Sagunto",
113 + "El Prat de LLobregat",
114 + "Viladecans",
115 + "Linares",
116 + "Alcoy",
117 + "Irún",
118 + "Estepona",
119 + "Torremolinos",
120 + "Rivas-Vaciamadrid",
121 + "Molina de Segura",
122 + "Paterna",
123 + "Granollers",
124 + "Santa Lucía de Tirajana",
125 + "Motril",
126 + "Cerdañola del Vallés",
127 + "Arrecife",
128 + "Segovia",
129 + "Torrelavega",
130 + "Elda",
131 + "Mérida",
132 + "Ávila",
133 + "Valdemoro",
134 + "Cuenta",
135 + "Collado Villalba",
136 + "Benalmádena",
137 + "Mollet del Vallés",
138 + "Puertollano",
139 + "Madrid",
140 + "Barcelona",
141 + "Valencia",
142 + "Sevilla",
143 + "Zaragoza",
144 + "Málaga",
145 + "Murcia",
146 + "Palma de Mallorca",
147 + "Las Palmas de Gran Canaria",
148 + "Bilbao",
149 + "Córdoba",
150 + "Alicante",
151 + "Valladolid",
152 + "Vigo",
153 + "Gijón",
154 + "Hospitalet de LLobregat",
155 + "La Coruña",
156 + "Granada",
157 + "Vitoria",
158 + "Elche",
159 + "Santa Cruz de Tenerife",
160 + "Oviedo",
161 + "Badalona",
162 + "Cartagena",
163 + "Móstoles",
164 + "Jerez de la Frontera",
165 + "Tarrasa, Sabadell",
166 + "Alcalá de Henares",
167 + "Pamplona",
168 + "Fuenlabrada",
169 + "Almería",
170 + "San Sebastián",
171 + "Leganés",
172 + "Santander",
173 + "Burgos",
174 + "Castellón de la Plana",
175 + "Alcorcón",
176 + "Albacete",
177 + "Getafe",
178 + "Salamanca",
179 + "Huelva",
180 + "Logroño",
181 + "Badajoz",
182 + "San Cristróbal de la Laguna",
183 + "León",
184 + "Tarragona",
185 + "Cádiz",
186 + "Lérida",
187 + "Marbella",
188 + "Mataró",
189 + "Dos Hermanas",
190 + "Santa Coloma de Gramanet",
191 + "Jaén",
192 + "Algeciras",
193 + "Torrejón de Ardoz",
194 + "Orense",
195 + "Alcobendas",
196 + "Reus",
197 + "Calahorra",
198 + "Inca"
199 + ])
200 +
201 + @doc """
202 + Return country.
203 +
204 + ## Examples
205 +
206 + iex> Faker.Address.Es.country()
207 + "Cabo Verde"
208 + iex> Faker.Address.Es.country()
209 + "Malawi"
210 + iex> Faker.Address.Es.country()
211 + "Bielorusia"
212 + iex> Faker.Address.Es.country()
213 + "Mali"
214 + """
215 + @spec country() :: String.t()
216 + sampler(:country, [
217 + "Afganistán",
218 + "Albania",
219 + "Argelia",
220 + "Andorra",
221 + "Angola",
222 + "Argentina",
223 + "Armenia",
224 + "Aruba",
225 + "Australia",
226 + "Austria",
227 + "Azerbayán",
228 + "Bahamas",
229 + "Barein",
230 + "Bangladesh",
231 + "Barbados",
232 + "Bielorusia",
233 + "Bélgica",
234 + "Belice",
235 + "Bermuda",
236 + "Bután",
237 + "Bolivia",
238 + "Bosnia Herzegovina",
239 + "Botswana",
240 + "Brasil",
241 + "Bulgaria",
242 + "Burkina Faso",
243 + "Burundi",
244 + "Camboya",
245 + "Camerún",
246 + "Canada",
247 + "Cabo Verde",
248 + "Islas Caimán",
249 + "Chad",
250 + "Chile",
251 + "China",
252 + "Isla de Navidad",
253 + "Colombia",
254 + "Comodos",
255 + "Congo",
256 + "Costa Rica",
257 + "Costa de Marfil",
258 + "Croacia",
259 + "Cuba",
260 + "Chipre",
261 + "República Checa",
262 + "Dinamarca",
263 + "Dominica",
264 + "República Dominicana",
265 + "Ecuador",
266 + "Egipto",
267 + "El Salvador",
268 + "Guinea Ecuatorial",
269 + "Eritrea",
270 + "Estonia",
271 + "Etiopía",
272 + "Islas Faro",
273 + "Fiji",
274 + "Finlandia",
275 + "Francia",
276 + "Gabón",
277 + "Gambia",
278 + "Georgia",
279 + "Alemania",
280 + "Ghana",
281 + "Grecia",
282 + "Groenlandia",
283 + "Granada",
284 + "Guadalupe",
285 + "Guam",
286 + "Guatemala",
287 + "Guinea",
288 + "Guinea-Bisau",
289 + "Guayana",
290 + "Haiti",
291 + "Honduras",
292 + "Hong Kong",
293 + "Hungria",
294 + "Islandia",
295 + "India",
296 + "Indonesia",
297 + "Iran",
298 + "Irak",
299 + "Irlanda",
300 + "Italia",
301 + "Jamaica",
302 + "Japón",
303 + "Jordania",
304 + "Kazajistan",
305 + "Kenia",
306 + "Kiribati",
307 + "Corea",
308 + "Kuwait",
309 + "Letonia",
310 + "Líbano",
311 + "Liberia",
312 + "Liechtenstein",
313 + "Lituania",
314 + "Luxemburgo",
315 + "Macao",
316 + "Macedonia",
317 + "Madagascar",
318 + "Malawi",
319 + "Malasia",
320 + "Maldivas",
321 + "Mali",
322 + "Malta",
323 + "Martinica",
324 + "Mauritania",
325 + "Méjico",
326 + "Micronesia",
327 + "Moldavia",
328 + "Mónaco",
329 + "Mongolia",
330 + "Montenegro",
331 + "Montserrat",
332 + "Marruecos",
333 + "Mozambique",
334 + "Namibia",
335 + "Nauru",
336 + "Nepal",
337 + "Holanda",
338 + "Nueva Zelanda",
339 + "Nicaragua",
340 + "Niger",
341 + "Nigeria",
342 + "Noruega",
343 + "Omán",
344 + "Pakistan",
345 + "Panamá",
346 + "Papúa Nueva Guinea",
347 + "Paraguay",
348 + "Perú",
349 + "Filipinas",
350 + "Poland",
351 + "Portugal",
352 + "Puerto Rico",
353 + "Rusia",
354 + "Ruanda",
355 + "Samoa",
356 + "San Marino",
357 + "Santo Tomé y Principe",
358 + "Arabia Saudí",
359 + "Senegal",
360 + "Serbia",
361 + "Seychelles",
362 + "Sierra Leona",
363 + "Singapur",
364 + "Eslovaquia",
365 + "Eslovenia",
366 + "Somalia",
367 + "España",
368 + "Sri Lanka",
369 + "Sudán",
370 + "Suriname",
371 + "Suecia",
372 + "Suiza",
373 + "Siria",
374 + "Taiwan",
375 + "Tajikistan",
376 + "Tanzania",
377 + "Tailandia",
378 + "Timor-Leste",
379 + "Togo",
380 + "Tonga",
381 + "Trinidad y Tobago",
382 + "Tunez",
383 + "Turquia",
384 + "Uganda",
385 + "Ucrania",
386 + "Emiratos Árabes Unidos",
387 + "Reino Unido",
388 + "Estados Unidos de América",
389 + "Uruguay",
390 + "Uzbekistan",
391 + "Vanuatu",
392 + "Venezuela",
393 + "Vietnam",
394 + "Yemen",
395 + "Zambia",
396 + "Zimbabwe"
397 + ])
398 +
399 + @doc """
400 + Return country code.
401 +
402 + ## Examples
403 +
404 + iex> Faker.Address.Es.country_code()
405 + "ES"
406 + """
407 + @spec country_code() :: String.t()
408 + sampler(:country_code, ["ES"])
409 +
410 + @doc """
411 + Return random secondary address.
412 +
413 + ## Examples
414 +
415 + iex> Faker.Address.Es.secondary_address()
416 + "Esc. 154"
417 + iex> Faker.Address.Es.secondary_address()
418 + "Esc. 646"
419 + iex> Faker.Address.Es.secondary_address()
420 + "Puerta 083"
421 + iex> Faker.Address.Es.secondary_address()
422 + "Esc. 970"
423 + """
424 + @spec secondary_address() :: String.t()
425 + def secondary_address do
426 + ["Esc. ###", "Puerta ###"]
427 + |> Enum.at(Faker.random_between(0, 1))
428 + |> Faker.format()
429 + end
430 +
431 + @doc """
432 + Return state.
433 +
434 + ## Examples
435 +
436 + iex> Faker.Address.Es.state()
437 + "Castilla-La Mancha"
438 + iex> Faker.Address.Es.state()
439 + "Comunidad Valenciana"
440 + iex> Faker.Address.Es.state()
441 + "Galicia"
442 + iex> Faker.Address.Es.state()
443 + "Cataluña"
444 + """
445 + @spec state() :: String.t()
446 + sampler(:state, [
447 + "Andalucía",
448 + "Aragón",
449 + "Principado de Asturias",
450 + "Baleares",
451 + "Canarias",
452 + "Cantabria",
453 + "Castilla-La Mancha",
454 + "Castilla y León",
455 + "Cataluña",
456 + "Comunidad Valenciana",
457 + "Extremadura",
458 + "Galicia",
459 + "La Rioja",
460 + "Comunidad de Madrid, Navarra",
461 + "País Vasco",
462 + "Región de Murcia"
463 + ])
464 +
465 + @doc """
466 + Return state abbr.
467 +
468 + ## Examples
469 +
470 + iex> Faker.Address.Es.state_abbr()
471 + "Ara"
472 + iex> Faker.Address.Es.state_abbr()
473 + "Cbr"
474 + iex> Faker.Address.Es.state_abbr()
475 + "Mad"
476 + iex> Faker.Address.Es.state_abbr()
477 + "Gal"
478 + """
479 + @spec state_abbr() :: String.t()
480 + sampler(:state_abbr, [
481 + "And",
482 + "Ara",
483 + "Ast",
484 + "Bal",
485 + "Can",
486 + "Cbr",
487 + "Man",
488 + "Leo",
489 + "Cat",
490 + "Com",
491 + "Ext",
492 + "Gal",
493 + "Rio",
494 + "Mad",
495 + "Nav",
496 + "Vas",
497 + "Mur"
498 + ])
499 +
500 + @doc """
501 + Return street address.
502 +
503 + ## Examples
504 +
505 + iex> Faker.Address.Es.street_address()
506 + "Elizabeth Mercado 26"
507 + iex> Faker.Address.Es.street_address()
508 + "Padberg Senda s/n."
509 + iex> Faker.Address.Es.street_address()
510 + "Ryan Enrique Sector 05"
511 + iex> Faker.Address.Es.street_address()
512 + "Price Colonia 02"
513 + """
514 + @spec street_address() :: String.t()
515 + def street_address do
516 + "#{street_name()} #{building_number()}"
517 + end
518 +
519 + @doc """
520 + Return `street_address/0` or if argument is `true` adds `secondary_address/0`.
521 +
522 + ## Examples
523 +
524 + iex> Faker.Address.Es.street_address(true)
525 + "Elizabeth Mercado 26 Esc. 610"
526 + iex> Faker.Address.Es.street_address(false)
527 + "Ryan Enrique Sector 05"
528 + iex> Faker.Address.Es.street_address(false)
529 + "Price Colonia 02"
530 + iex> Faker.Address.Es.street_address(false)
531 + "Ernser Calleja 2"
532 + """
533 + @spec street_address(true | any) :: String.t()
534 + def street_address(true), do: street_address() <> " " <> secondary_address()
535 + def street_address(_), do: street_address()
536 +
537 + @doc """
538 + Return street name.
539 +
540 + ## Examples
541 +
542 + iex> Faker.Address.Es.street_name()
543 + "Elizabeth Mercado"
544 + iex> Faker.Address.Es.street_name()
545 + "Sipes Trycia Colegio"
546 + iex> Faker.Address.Es.street_name()
547 + "Schiller Delphine Chalet"
548 + iex> Faker.Address.Es.street_name()
549 + "Murphy Sector"
550 + """
551 + @spec street_name() :: String.t()
552 + def street_name do
553 + street_name(Faker.random_between(0, 2))
554 + end
555 +
556 + defp street_name(0), do: "#{Name.first_name()} #{street_suffix()}"
557 + defp street_name(1), do: "#{Name.last_name()} #{street_suffix()}"
558 + defp street_name(2), do: "#{Name.last_name()} #{Name.first_name()} #{street_suffix()}"
559 +
560 + @doc """
561 + Return street suffix.
562 +
563 + ## Examples
564 +
565 + iex> Faker.Address.Es.street_suffix()
566 + "Entrada"
567 + iex> Faker.Address.Es.street_suffix()
568 + "Ramal"
569 + iex> Faker.Address.Es.street_suffix()
570 + "Mercado"
571 + iex> Faker.Address.Es.street_suffix()
572 + "Riera"
573 + """
574 + @spec street_suffix() :: String.t()
575 + sampler(:street_suffix, [
576 + "Aldea",
577 + "Apartamento",
578 + "Arrabal",
579 + "Arroyo",
580 + "Avenida",
581 + "Bajada",
582 + "Barranco",
583 + "Barrio",
584 + "Bloque",
585 + "Calle",
586 + "Calleja",
587 + "Camino",
588 + "Carretera",
589 + "Caserio",
590 + "Colegio",
591 + "Colonia",
592 + "Conjunto",
593 + "Cuesta",
594 + "Chalet",
595 + "Edificio",
596 + "Entrada",
597 + "Escalinata",
598 + "Explanada",
599 + "Extramuros",
600 + "Extrarradio",
601 + "Ferrocarril",
602 + "Glorieta",
603 + "Gran Subida",
604 + "Grupo",
605 + "Huerta",
606 + "Jardines",
607 + "Lado",
608 + "Lugar",
609 + "Manzana",
610 + "Masía",
611 + "Mercado",
612 + "Monte",
613 + "Muelle",
614 + "Municipio",
615 + "Parcela",
616 + "Parque",
617 + "Partida",
618 + "Pasaje",
619 + "Paseo",
620 + "Plaza",
621 + "Poblado",
622 + "Polígono",
623 + "Prolongación",
624 + "Puente",
625 + "Puerta",
626 + "Quinta",
627 + "Ramal",
628 + "Rambla",
629 + "Rampa",
630 + "Riera",
631 + "Rincón",
632 + "Ronda",
633 + "Rua",
634 + "Salida",
635 + "Sector",
636 + "Sección",
637 + "Senda",
638 + "Solar",
639 + "Subida",
640 + "Terrenos",
641 + "Torrente",
642 + "Travesía",
643 + "Urbanización",
644 + "Vía",
645 + "Vía Pública"
646 + ])
647 +
648 + @doc """
649 + Return time zone.
650 +
651 + ## Examples
652 +
653 + iex> Faker.Address.Es.time_zone()
654 + "Australia/Sydney"
655 + iex> Faker.Address.Es.time_zone()
656 + "America/Guyana"
657 + iex> Faker.Address.Es.time_zone()
658 + "Asia/Kathmandu"
659 + iex> Faker.Address.Es.time_zone()
660 + "Europa/Vienna"
661 + """
662 + @spec time_zone() :: String.t()
663 + sampler(:time_zone, [
664 + "Pacífico/Midway",
665 + "Pacífico/Pago_Pago",
666 + "Pacífico/Honolulu",
667 + "America/Juneau",
668 + "America/Los_Angeles",
669 + "America/Tijuana",
670 + "America/Denver",
671 + "America/Phoenix",
672 + "America/Chihuahua",
673 + "America/Mazatlan",
674 + "America/Chicago",
675 + "America/Regina",
676 + "America/Mexico_City",
677 + "America/Monterrey",
678 + "America/Guatemala",
679 + "America/New_York",
680 + "America/Indiana/Indianapolis",
681 + "America/Bogota",
682 + "America/Lima",
683 + "America/Halifax",
684 + "America/Caracas",
685 + "America/La_Paz",
686 + "America/Santiago",
687 + "America/St_Johns",
688 + "America/Sao_Paulo",
689 + "America/Argentina/Buenos_Aires",
690 + "America/Guyana",
691 + "America/Godthab",
692 + "Atlantic/South_Georgia",
693 + "Atlantic/Azores",
694 + "Atlantic/Cape_Verde",
695 + "Europa/Dublin",
696 + "Europa/Lisbon",
697 + "Europa/London",
698 + "Africa/Casablanca",
699 + "Africa/Monrovia",
700 + "Etc/UTC",
701 + "Europa/Belgrade",
702 + "Europa/Bratislava",
703 + "Europa/Budapest",
704 + "Europa/Ljubljana",
705 + "Europa/Prague",
706 + "Europa/Sarajevo",
707 + "Europa/Skopje",
708 + "Europa/Warsaw",
709 + "Europa/Zagreb",
710 + "Europa/Brussels",
711 + "Europa/Copenhagen",
712 + "Europa/Madrid",
713 + "Europa/Paris",
714 + "Europa/Amsterdam",
715 + "Europa/Berlin",
716 + "Europa/Rome",
717 + "Europa/Stockholm",
718 + "Europa/Vienna",
719 + "Africa/Algiers",
720 + "Europa/Bucharest",
721 + "Africa/Cairo",
722 + "Europa/Helsinki",
723 + "Europa/Kiev",
724 + "Europa/Riga",
725 + "Europa/Sofia",
726 + "Europa/Tallinn",
727 + "Europa/Vilnius",
728 + "Europa/Athens",
729 + "Europa/Istanbul",
730 + "Europa/Minsk",
731 + "Asia/Jerusalen",
732 + "Africa/Harare",
733 + "Africa/Johannesburg",
734 + "Europa/Moscú",
735 + "Asia/Kuwait",
736 + "Asia/Riyadh",
737 + "Africa/Nairobi",
738 + "Asia/Baghdad",
739 + "Asia/Tehran",
740 + "Asia/Muscat",
741 + "Asia/Baku",
742 + "Asia/Tbilisi",
743 + "Asia/Yerevan",
744 + "Asia/Kabul",
745 + "Asia/Yekaterinburg",
746 + "Asia/Karachi",
747 + "Asia/Tashkent",
748 + "Asia/Kolkata",
749 + "Asia/Kathmandu",
750 + "Asia/Dhaka",
751 + "Asia/Colombo",
752 + "Asia/Almaty",
753 + "Asia/Novosibirsk",
754 + "Asia/Rangoon",
755 + "Asia/Bangkok",
756 + "Asia/Jakarta",
757 + "Asia/Krasnoyarsk",
758 + "Asia/Shanghai",
759 + "Asia/Chongqing",
760 + "Asia/Hong_Kong",
761 + "Asia/Urumqi",
762 + "Asia/Kuala_Lumpur",
763 + "Asia/Singapore",
764 + "Asia/Taipei",
765 + "Australia/Perth",
766 + "Asia/Irkutsk",
767 + "Asia/Ulaanbaatar",
768 + "Asia/Seoul",
769 + "Asia/Tokyo",
770 + "Asia/Yakutsk",
771 + "Australia/Darwin",
772 + "Australia/Adelaide",
773 + "Australia/Melbourne",
774 + "Australia/Sydney",
775 + "Australia/Brisbane",
776 + "Australia/Hobart",
777 + "Asia/Vladivostok",
778 + "Pacífico/Guam",
779 + "Pacífico/Port_Moresby",
780 + "Asia/Magadan",
781 + "Pacífico/Noumea",
782 + "Pacífico/Fiji",
783 + "Asia/Kamchatka",
784 + "Pacífico/Majuro",
785 + "Pacífico/Auckland",
786 + "Pacífico/Tongatapu",
787 + "Pacífico/Fakaofo",
788 + "Pacífico/Apia"
789 + ])
790 +
791 + @doc """
792 + Return random postcode.
793 +
794 + ## Examples
795 +
796 + iex> Faker.Address.Es.zip_code()
797 + "01542"
798 + iex> Faker.Address.Es.zip_code()
799 + "64610"
800 + iex> Faker.Address.Es.zip_code()
801 + "83297"
802 + iex> Faker.Address.Es.zip_code()
803 + "05235"
804 + """
805 + @spec zip_code() :: String.t()
806 + def zip_code do
807 + ["#####"]
808 + |> Enum.at(0)
809 + |> Faker.format()
810 + end
811 + end
Loading more files…