Packages

Battlenet is an Elixir library that exposes Blizzard's Community Platform API.

Current section

Files

Jump to
battlenetex lib battlenet api base.ex
Raw

lib/battlenet/api/base.ex

defmodule Battlenet.API.Base do
use HTTPoison.Base
def process_url(url) do
Battlenet.Config.api_site_url
|> URI.merge(url)
|> to_string
end
def process_response_body(body) do
body
|> Poison.decode!
# |> Enum.map(&to_atom_key_value/1)
end
defp to_atom_key_value({ key, value }) do
{ String.to_atom(key), value }
end
end