Packages
extwitter
0.8.4
0.14.0
0.13.1
0.13.0
0.12.5
0.12.4
0.12.3
0.12.2
0.12.1
0.12.0
0.11.0
0.10.0
0.9.6
0.9.5
0.9.4
0.9.3
0.9.2
0.9.1
0.9.0
0.8.6
0.8.5
0.8.4
0.8.3
0.8.2
0.8.1
0.8.0
0.7.3
0.7.2
0.7.1
0.7.0
0.6.3
0.6.2
0.6.1
0.6.0
0.5.5
0.5.4
0.5.3
0.5.2
0.5.1
0.5.0
0.4.5
0.4.4
0.4.3
0.4.2
0.4.1
0.4.0
0.3.0
0.2.1
0.2.0
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
Twitter client library for Elixir.
Current section
Files
Jump to
Current section
Files
lib/extwitter/json.ex
defmodule ExTwitter.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, keys: :atoms)
end
@doc """
Decode json string into elixir objects.
"""
def decode(json) do
Poison.decode(json, keys: :atoms)
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