Create a gist now

Instantly share code, notes, and snippets.

anonymous /recjson.erl
Created Aug 19, 2010

-record(topscore, {place, user_id, score}).
-record(topscores, {scores}).
T1 = #topscore{place = <<"1">>, user_id = <<"Us">>, score = <<"200">>},
T2 = #topscore{place = <<"2">>, user_id = <<"Us2">>, score = <<"400">>},
Scores = #topscores{scores = [T1|T2]},
Json = ?record_to_json(topscores, Scores),
io:format("~p~n", [Json]).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment