Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional callbacks for functions with default params #319

Merged
merged 1 commit into from
Dec 21, 2018

Conversation

devonestes
Copy link
Contributor

In pretty much every public function in ex_machina you allow users to
either give or not give parameters for the resource that's being built,
but in the documentation that's not shown because you can't show
optional arguments in callback definitions.

This commit adds callbacks for these /1 or /2 functions that are
commonly used. This benefits documentation, but also enforces the
behaviour contract to make sure that all documented functionality is
implemented correctly.

I also formatted the files that I touched (because that's just what my
editor does when I save a file 😉).

In pretty much every public function in `ex_machina` you allow users to
either give or not give parameters for the resource that's being built,
but in the documentation that's not shown because you can't show
optional arguments in callback definitions.

This commit adds callbacks for these `/1` or `/2` functions that are
commonly used. This benefits documentation, but also enforces the
behaviour contract to make sure that all documented functionality is
implemented correctly.
@germsvel
Copy link
Collaborator

Nice catch with this. Thanks for adding these @devonestes!

@germsvel germsvel merged commit 871a836 into beam-community:master Dec 21, 2018
@devonestes devonestes deleted the better-docs branch December 22, 2018 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants