diff options
author | Steven Blowers <sblowers@findmypast.com> | 2016-09-12 09:24:03 +0100 |
---|---|---|
committer | Steven Blowers <sblowers@findmypast.com> | 2016-09-12 09:24:03 +0100 |
commit | 19afd07efc19b213006b9bf29bcb91a1951f6adb (patch) | |
tree | 43064e77cbf599f39cd8c1316fa5b3722328505c /lib | |
parent | c0a2865d8d26bbbee42969c5e67fd924afb734af (diff) | |
download | zendex-19afd07efc19b213006b9bf29bcb91a1951f6adb.tar.gz zendex-19afd07efc19b213006b9bf29bcb91a1951f6adb.tar.xz |
Adding specs checked by dialyzer.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/zendex/connection.ex | 1 | ||||
-rw-r--r-- | lib/zendex/ticket.ex | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/zendex/connection.ex b/lib/zendex/connection.ex index d32f148..4717e4f 100644 --- a/lib/zendex/connection.ex +++ b/lib/zendex/connection.ex @@ -4,6 +4,7 @@ defmodule Zendex.Connection do username and password. """ + @typedoc "The connection paramters" @type t :: %{base_url: String.t, authentication: binary} @spec set_up(String.t, String.t, String.t) :: t diff --git a/lib/zendex/ticket.ex b/lib/zendex/ticket.ex index 952fbf4..5e2b66e 100644 --- a/lib/zendex/ticket.ex +++ b/lib/zendex/ticket.ex @@ -8,12 +8,13 @@ defmodule Zendex.Ticket do @http_client Application.get_env(:zendex, :http_client) - @spec list(Zendex.Connection.t) :: String.t + @spec list(Zendex.Connection.t) :: HTTPoison.Response.t def list(connection) do @http_client.get!(connection.base_url <> @url, [{"Authorization", "Basic #{connection.authentication}"}]) end + @spec create(Zendex.Connection.t, map) :: HTTPoison.Response.t def create(connection, ticket) do @http_client.post!(connection.base_url <> @url, Poison.encode!(ticket), |