Skip to content

Commit

Permalink
Improvement of type spec for balance method of bank account exercidse (
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiy-yevtushenko authored Aug 29, 2023
1 parent c6135de commit c2f2423
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion exercises/practice/bank-account/.meta/example.ex
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ defmodule BankAccount do
@doc """
Get the account's balance.
"""
@spec balance(account) :: integer
@spec balance(account) :: integer | {:error, :account_closed}
def balance(account) do
if Process.alive?(account) do
GenServer.call(account, :balance)
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/bank-account/lib/bank_account.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule BankAccount do
@doc """
Get the account's balance.
"""
@spec balance(account) :: integer
@spec balance(account) :: integer | {:error, :account_closed}
def balance(account) do
end

Expand Down

0 comments on commit c2f2423

Please sign in to comment.