Skip to content

Commit

Permalink
Further clarify documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dylan-chong committed Jan 3, 2018
1 parent 8615554 commit 39ef7ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ex_structable/hooks.ex
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ defmodule ExStructable.Hooks do
The return value is the return value of
`YourModule.new/2`/`YourModule.put/3`, so usually returns a struct when
validation passes.
validation passes. (You could return something else if you want to.)
When validation fails you should raise, or return a custom error value such
as `{:error, struct, reason}`. If validation fails, one option would be to
alter the struct so that it is valid. The choice of implementation is up to
the developer.
you.
By default returns the given struct without any checking.
Expand Down

0 comments on commit 39ef7ab

Please sign in to comment.