Current section

Files

Jump to
ex_trello lib ex_trello json.ex
Raw

lib/ex_trello/json.ex

defmodule ExTrello.JSON do
@moduledoc """
JSON encode/decode wrapper module. It's separated to isolate the code
affected by differences between the JSON libraries.
"""
@doc """
Decode json string into elixir objects.
"""
def decode!(json) do
Poison.decode!(json)
end
@doc """
Decode json string into elixir objects.
"""
def decode(json) do
Poison.decode(json)
end
@doc """
Get elixir object for the specified key.
Some libraries returns as tuples, and some returns HashDict.
"""
def get(object, key) do
Map.get(object, key, [])
end
end