View Source URL.Tel (URL v2.0.0)

Parses a tel URL

Summary

Functions

Parse a URI with the :scheme of "tel"

Types

@type t() :: %URL.Tel{params: map(), tel: String.t()}

Functions

@spec parse(URI.t()) :: {:ok, t()} | {:error, {module(), binary()}}

Parse a URI with the :scheme of "tel"

Examples

iex> tel = URI.parse "tel:+61-0407-555-987"
iex> URL.Tel.parse(tel)
{:ok, %URL.Tel{tel: "+61 407 555 987", params: %{}}}

iex> tel = URI.parse "tel:0407-555-987;phone-context=+61"
iex> URL.Tel.parse(tel)
{:ok, %URL.Tel{tel: "+61 407 555 987", params: %{"phone-context" => "+61"}}}