   end
 
   @doc """
-  Converts an Erlang time tuple (like those produced by the `:calendar` module) to a `Time` struct.
+  Converts an Erlang time tuple to a `Time` struct.
 
   ## Examples
 

  end

  @doc """
  Converts the given naive date time to ISO8601.

  Only supports converting naive date times which are in the ISO calendar,

      iex> Time.from_erl({24, 30, 15})
      {:error, :invalid_time}
  """
  @spec from_erl(:calendar.time(), Calendar.microsecond) :: {:ok, Time.t} | {:error, atom}
  def from_erl({hour, minute, second}, microsecond \\ 0) do
    new(hour, minute, second, microsecond)
  end

  @doc """
  Converts an Erlang time tuple to a `Time` struct.

  ## Examples

      iex> Time.from_erl!({23, 30, 15}, 5000)
      %Time{hour: 23, minute: 30, second: 15, microsecond: 5000}
      iex> Time.from_erl!({24, 30, 15})
      ** (ArgumentError) cannot convert {24, 30, 15} to time, reason: :invalid_time
  """
  @spec from_erl!(:calendar.time(), Calendar.microsecond) :: Time.t | no_return
  def from_erl!(tuple, microsecond \\ 0) do
    case from_erl(tuple, microsecond) do
      {:ok, value} ->
        value
      {:error, reason} ->
        raise ArgumentError, "cannot convert #{inspect tuple} to time, reason: #{inspect reason}"
    end
  end
end

