Skip to content

Commit

Permalink
Merge pull request #220 from laSinteZ/master
Browse files Browse the repository at this point in the history
chore: removed trailing whitespaces, added newline
  • Loading branch information
iamvery authored May 3, 2018
2 parents e8bb665 + 5247fcf commit 08c90ce
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ $ mix meditate --no-clear-screen

If you want to jump to a specific lesson, run it with `--koan=<koan name>`
```sh
$ mix meditate --koan=PatternMatching
$ mix meditate --koan=PatternMatching
```

Any typos on the koan name will show the complete list of koans, where you can pick any.
Expand Down
1 change: 0 additions & 1 deletion lib/koans/11_sigils.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ defmodule Sigils do
assert ~W(Hello #{1+1}) == ___
end
end

16 changes: 8 additions & 8 deletions lib/koans/18_genservers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ defmodule GenServers do

####
# GenServer implementation

def handle_call(:get_password, _from, current_password) do
{:reply, current_password, current_password}
{:reply, current_password, current_password}
end

def handle_call(:get_manufacturer, _from, current_state) do
Expand All @@ -68,22 +68,22 @@ defmodule GenServers do
def handle_call(:name_check, _from, current_state) do
{:reply, "Congrats! Your process was successfully named.", current_state}
end

def handle_call({:unlock, password}, _from, current_password) do
case password do
password when password === current_password ->
{:reply, {:ok, "Laptop unlocked!"}, current_password}
_ ->
_ ->
{:reply, {:error, "Incorrect password!"}, current_password}
end
end

def handle_cast({:change_password, old_password, new_password}, current_password) do
case old_password do
old_password when old_password == current_password ->
{:noreply, new_password}
_ ->
{:noreply, current_password}
{:noreply, current_password}
end
end
end
Expand Down Expand Up @@ -147,7 +147,7 @@ defmodule GenServers do
{_, response} = Laptop.unlock("EL!73")
assert response == ___

{_, response} = Laptop.owner_name
{_, response} = Laptop.owner_name
assert response == ___
end
end
end

0 comments on commit 08c90ce

Please sign in to comment.