Skip to content

Instantly share code, notes, and snippets.

Created August 19, 2010 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/538245 to your computer and use it in GitHub Desktop.
Save anonymous/538245 to your computer and use it in GitHub Desktop.
-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