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

Custom parameter coercion using coerce_with #1135 #1161

Merged
merged 1 commit into from
Sep 21, 2015

Conversation

dslh
Copy link
Contributor

@dslh dslh commented Sep 21, 2015

Addresses issue #1135. Adds coerce_using option to
Grape::DSL::Parameters::requires and ::optional,
allowing implementors arbitrary coercion uncoupled
from the parameter type.

See README.md#custom-types-and-coercions for usage.

@dblock
Copy link
Member

dblock commented Sep 21, 2015

This is very good. Before I merge it, should it be coerce_with:? We have using: for header type versioning but we have with: for present. Any strong feelings?

Addresses issue ruby-grape#1135. Adds `coerce_with` option to
`Grape::DSL::Parameters::requires` and `::optional`,
allowing implementors arbitrary coercion uncoupled
from the parameter type.

See README.md#custom-types-and-coercions for usage.
@dslh dslh changed the title Custom parameter coercion with coerce_using #1135 Custom parameter coercion using coerce_with #1135 Sep 21, 2015
dblock added a commit that referenced this pull request Sep 21, 2015
Custom parameter coercion using `coerce_with` #1135
@dblock dblock merged commit 7722cd1 into ruby-grape:master Sep 21, 2015
@dblock
Copy link
Member

dblock commented Sep 21, 2015

Merged.

@dslh dslh deleted the issue/1135 branch September 22, 2015 14:50
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