Skip to content

Instantly share code, notes, and snippets.

@epappas
Created June 14, 2014 12:47
Show Gist options
  • Save epappas/c0bd7e28631c2b4fb31d to your computer and use it in GitHub Desktop.
Save epappas/c0bd7e28631c2b4fb31d to your computer and use it in GitHub Desktop.
An example of use of jiffy
{[{<<"arr">>,[1,2,3,4]},
{<<"arrStr">>,[<<"a">>,<<"b">>]},
{<<"arrobj">>,[{[{<<"a">>,1},{<<"b">>,2}]}]},
{<<"obj">>,
{[{<<"key1">>,<<"payload1">>},{<<"key2">>,<<"payload1">>}]}},
{<<"testBool">>,true},
{<<"testInt">>,1},
{<<"testStr">>,<<"abc">>},
{<<"testReal">>,1.2}]} = jiffy:decode(<<"
{
\"arr\": [1,2,3,4],
\"arrStr\": [\"a\",\"b\"],
\"arrobj\": [{\"a\": 1,\"b\": 2}],
\"obj\": {
\"key1\": \"payload1\",
\"key2\": \"payload1\"
},
\"testBool\": true,
\"testInt\": 1,
\"testStr\": \"abc\",
\"testReal\": 1.2
}
">>).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment