URL v1.2.0 URL.Tel View Source

Parses a tel URL

Link to this section Summary

Functions

Parse a URI with the :scheme of "tel"

Link to this section Types

Link to this type

t()

View Source
t() :: %URL.Tel{params: Map.t(), tel: String.t()}

Link to this section Functions

Link to this function

parse(uri)

View Source
parse(URI.t()) :: 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)
%URL.Tel{params: %{}, tel: "+61 407 555 987"}

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