Skip to content

Commit

Permalink
Add better module documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
DevL committed Mar 14, 2015
1 parent 3816f3d commit 319697f
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions lib/guardsafe.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,25 @@ defmodule Guardsafe do
## Examples
def double(number) when nil?(number), do: 0
defmodule MacrofyAllTheThings do
import Guardsafe
require Integer
iex> import Guardsafe
nil
iex> nil |> nil?
true
iex> [] |> tuple?
false
iex> require Integer
nil
iex> even? 2
true
def magic(number) when number |> nil? do
"Staring into the void..."
end
def magic(number) when number |> even? do
"That's not odd."
end
def magic(number) when number |> divisible_by? 5 do
"High five!"
end
end
iex> MacrofyAllTheThings.magic(8)
"That's not odd."
"""

@doc """
Expand Down

0 comments on commit 319697f

Please sign in to comment.