Skip to content
Permalink
Browse files

Add doctest for init/0

  • Loading branch information
ericdouglas committed Sep 5, 2017
1 parent c39db44 commit 98af109bbdbc21c7bd4559a1870eac267917e104
Showing with 18 additions and 0 deletions.
  1. +18 −0 lib/todo_list.ex
@@ -7,6 +7,24 @@ defmodule TodoList do
@path_env %{dev: ["lib", "todos.csv"], test: ["lib", "todos_test.csv"]}
@path Path.join(@path_env[Mix.env])

@doc """
Read the .csv file and return its content formatted
## Examples
iex> TodoList.init
%TodoList{
last_id: 1,
todos: %{
1 => %Todo{
id: 1,
task: "Study Erlang",
date: "2018-01-01",
status: "todo"
}
}
}
"""
def init do
@path
|> read_file!

0 comments on commit 98af109

Please sign in to comment.
You can’t perform that action at this time.