grape

https://github.com/intridea/grape

Ruby

An opinionated framework for creating REST-like APIs in Ruby.

Grape::Validations::Types.build_coercer

Work out the +Virtus::Attribute+ object to
use for coercing strings to the given +type+.
Coercion +method+ will be inferred if none is
supplied.

If a +Virtus::Attribute+ object already built
with +Virtus::Attribute.build+ is supplied as
the +type+ it will be returned and +method+
will be ignored.

See {CustomTypeCoercer} for further details
about coercion and type-checking inference.

Source | Google | Stack overflow

Edit

git clone [email protected]:intridea/grape.git

cd grape

open lib/grape/validations/types.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Grape--Validations--Types-build_coercer-for-pr


# Commit to git

git add lib/grape/validations/types.rbgit commit -m "better docs for Grape::Validations::Types.build_coercer"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Grape--Validations--Types-build_coercer-for-pr

hub pull-request


# Celebrate!