Packages

Dead simple Elixir wrapper for the ProfitBricks API.

Current section

Files

Jump to
profitbricks_api_wrapper lib profitbricks_debug.ex
Raw

lib/profitbricks_debug.ex

defmodule ProfitBricks.Debug do
@moduledoc """
Debug wrappers.
"""
def get(path) do
get(path, [])
end
def get(path, opts) do
output ProfitBricks.get(path, opts)
:ok
end
def post(path, data) do
post(path, data, [])
end
def post(path, data, opts) do
output ProfitBricks.post(path, data, opts)
:ok
end
def put(path, data) do
put(path, data, [])
end
def put(path, data, opts) do
output ProfitBricks.put(path, data, opts)
:ok
end
def delete(path) do
delete(path, [])
end
def delete(path, opts) do
output ProfitBricks.put(path, opts)
:ok
end
defp output(response) do
IO.puts("Status: #{response.status}")
IO.puts "Headers:"
Apex.ap response.headers
IO.puts "Body:"
Apex.ap response.body
end
end