diff --git a/LICENSE.md b/LICENSE.md index 9e5804c..839a398 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 ExPhoneNumber +Copyright (c) 2023-2024 ExPhoneNumber Copyright (c) 2016-2022 NLCollect B.V. diff --git a/README.md b/README.md index 8a06799..35e5a23 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ There is a `mix update_metadata` task that downloads the latest `libphonenumber` ## Copyright and License -Copyright (c) 2023 ExPhoneNumber +Copyright (c) 2023-2024 ExPhoneNumber Copyright (c) 2016-2022 NLCollect B.V. diff --git a/lib/ex_phone_number.ex b/lib/ex_phone_number.ex index 183e039..eaabc7a 100644 --- a/lib/ex_phone_number.ex +++ b/lib/ex_phone_number.ex @@ -1,5 +1,34 @@ defmodule ExPhoneNumber do - @moduledoc false + @moduledoc """ + Parsing, formatting, and validating international phone numbers. + + ## Example Usage + + iex> ExPhoneNumber.parse("202-456-1111", "US") + { + :ok, + %ExPhoneNumber.Model.PhoneNumber{ + country_code: 1, + country_code_source: nil, + extension: nil, + italian_leading_zero: nil, + national_number: 2024561111, + number_of_leading_zeros: nil, + preferred_domestic_carrier_code: nil, + raw_input: nil + } + } + + iex> {:ok, phone_number} = ExPhoneNumber.parse("202-456-1111", "US") + iex> ExPhoneNumber.format(phone_number, :e164) + "+12024561111" + iex> ExPhoneNumber.is_valid_number?(phone_number) + true + iex> ExPhoneNumber.is_possible_number?(phone_number) + true + iex> ExPhoneNumber.get_number_type(phone_number) + :fixed_line_or_mobile + """ alias ExPhoneNumber.Formatting alias ExPhoneNumber.Parsing diff --git a/mix.exs b/mix.exs index d98044c..4fa6b23 100644 --- a/mix.exs +++ b/mix.exs @@ -54,11 +54,12 @@ defmodule ExPhoneNumber.Mixfile do defp docs do [ - extras: ["README.md"], + extras: ["README.md", "LICENSE.md", "CHANGELOG.md"], main: "readme", source_url: @source_url, source_ref: "v#{@version}", - homepage_url: @source_url + homepage_url: @source_url, + skip_undefined_reference_warnings_on: ["CHANGELOG.md"] ] end end diff --git a/test/ex_phone_number_test.exs b/test/ex_phone_number_test.exs new file mode 100644 index 0000000..0c9c94e --- /dev/null +++ b/test/ex_phone_number_test.exs @@ -0,0 +1,5 @@ +defmodule ExPhoneNumberTest do + use ExSpec, async: true + + doctest ExPhoneNumber +end