anonymous / recjson.erl
Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View recjson.erl
1 2 3 4 5 6 7 8
-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
Something went wrong with that request. Please try again.