Created
August 1, 2014 03:03
-
-
Save knewter/f2fa46dc543ae20fd662 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule HexClient do | |
use HTTPoison.Base | |
@base_url "https://hex.pm/api/" | |
def packages, do: packages_path |> get_body | |
defp get_body(path), do: get(path).body | |
defp packages_path, do: "packages" | |
def process_url(url), do: @base_url <> url | |
def process_response_body(body), do: JSEX.decode!(body) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment