aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Blowers <shdblowers@gmail.com>2016-10-30 19:51:35 (GMT)
committerSteven Blowers <shdblowers@gmail.com>2016-10-30 19:51:35 (GMT)
commitf7d7d8f441840962ed7d1809b808462d4a7ad9a8 (patch)
tree4884e43029b8912e80cc8c3261bb9762820c58d9
parentf50573d7c25ee55c4af55f32adc4d638244e1bfc (diff)
downloadzendex-f7d7d8f441840962ed7d1809b808462d4a7ad9a8.tar.gz
zendex-f7d7d8f441840962ed7d1809b808462d4a7ad9a8.tar.xz
minor refactoring
-rw-r--r--lib/zendex/ticket.ex6
-rw-r--r--lib/zendex/user.ex9
2 files changed, 5 insertions, 10 deletions
diff --git a/lib/zendex/ticket.ex b/lib/zendex/ticket.ex
index 8a7fd8a..9232d6e 100644
--- a/lib/zendex/ticket.ex
+++ b/lib/zendex/ticket.ex
@@ -14,8 +14,7 @@ defmodule Zendex.Ticket do
"""
@spec list(Zendex.Connection.t) :: map
def list(connection) do
- connection.base_url
- |> Kernel.<>(@url)
+ "#{connection.base_url}#{@url}"
|> @http_client.get!(CommonHelpers.get_headers(connection.authentication))
|> CommonHelpers.decode_response
end
@@ -25,8 +24,7 @@ defmodule Zendex.Ticket do
"""
@spec create(Zendex.Connection.t, map) :: map
def create(connection, ticket) do
- connection.base_url
- |> Kernel.<>(@url)
+ "#{connection.base_url}#{@url}"
|> @http_client.post!(Poison.encode!(ticket),
CommonHelpers.get_headers(connection.authentication,
%{content_type: :json}))
diff --git a/lib/zendex/user.ex b/lib/zendex/user.ex
index 4615657..8479735 100644
--- a/lib/zendex/user.ex
+++ b/lib/zendex/user.ex
@@ -13,8 +13,7 @@ defmodule Zendex.User do
"""
@spec list(Zendex.Connection.t) :: map
def list(connection) do
- connection.base_url
- |> Kernel.<>("#{@url}.json")
+ "#{connection.base_url}#{@url}.json"
|> @http_client.get!(CommonHelpers.get_headers(connection.authentication))
|> CommonHelpers.decode_response
end
@@ -24,8 +23,7 @@ defmodule Zendex.User do
"""
@spec show(Zendex.Connection.t, integer) :: map
def show(connection, id) do
- connection.base_url
- |> Kernel.<>("#{@url}/#{id}.json")
+ "#{connection.base_url}#{@url}/#{id}.json"
|> @http_client.get!(CommonHelpers.get_headers(connection.authentication))
|> CommonHelpers.decode_response
end
@@ -35,8 +33,7 @@ defmodule Zendex.User do
"""
@spec create(Zendex.Connection.t, map) :: map
def create(connection, user) do
- connection.base_url
- |> Kernel.<>("#{@url}.json")
+ "#{connection.base_url}#{@url}.json"
|> @http_client.post!(Poison.encode!(user),
CommonHelpers.get_headers(connection.authentication,
%{content_type: :json}))