Congratulate when koans are complete

This commit is contained in:
Jay Hayes
2016-04-26 17:35:31 -05:00
parent 7903923e36
commit 6ae1cae4b8
3 changed files with 9 additions and 0 deletions

View File

@@ -19,6 +19,11 @@ defmodule Tracker do
end)
end
def complete? do
{total, completed} = Agent.get(__MODULE__, &(&1))
total == Enum.count(completed)
end
def summarize({total, completed}) do
%{total: total, current: MapSet.size(completed)}
end