From 35e2a05ce0bf3f066bf0c21f1997db95b8a10800 Mon Sep 17 00:00:00 2001 From: Paul Ruescher Date: Mon, 16 Oct 2017 23:23:09 -0700 Subject: [PATCH 1/8] Convert function returns to be more idiomatic elixir --- lib/facebook.ex | 130 ++++++++++++++++---------------- lib/facebook/graph.ex | 46 +++++++----- mix.exs | 4 +- test/facebook_test.exs | 163 ++++++++++++++++++++--------------------- 4 files changed, 177 insertions(+), 166 deletions(-) diff --git a/lib/facebook.ex b/lib/facebook.ex index bb28a6d..ddf46b1 100644 --- a/lib/facebook.ex +++ b/lib/facebook.ex @@ -30,7 +30,7 @@ defmodule Facebook do @type fields :: list @type access_token :: String.t - @type response :: {:json, HashDict.t} | {:body, String.t} + @type response :: {:ok, HashDict.t} | {:body, String.t} @type using_appsecret :: boolean @type reaction :: :reaction @@ -111,10 +111,10 @@ defmodule Facebook do ## Example iex> Facebook.publish(:photo, "", "", [], "") - {:json, %{"id" => "..."}} + {:ok, %{"id" => "..."}} iex> Facebook.publish(:video, "", "