Clarify keyword list as options example by including else clause
This commit is contained in:
@@ -34,9 +34,14 @@ defmodule KeywordLists do
|
||||
|
||||
koan "Conveniently keyword lists can be used for function options" do
|
||||
transform = fn str, opts ->
|
||||
if opts[:upcase], do: String.upcase(str)
|
||||
if opts[:upcase] do
|
||||
String.upcase(str)
|
||||
else
|
||||
str
|
||||
end
|
||||
end
|
||||
|
||||
assert transform.("good", upcase: true) == ___
|
||||
assert transform.("good", upcase: false) == ___
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user