Type::API::Constraint::Coercible - allows values failing the type constraint to be converted to another value that passes
Implementations of Type::API::Constraint::Coercible MUST also implement Type::API::Constraint.
Implementations MUST provide the following methods:
Returns a boolean indicating whether a coercion is available for this type constraint.
Attempts to coerce the value into a value that would pass the type constraint; this method returns the new value.
This method offers no guarantee that the returned value passes the constraint; that must be checked with
Implementations MAY advertise that they support this interface by returning true for
The following CPAN classes are known to implement Type::API::Constraint::Coercible:
Some tools can make use of objects implementing Type::API::Constraint::Coercible:
Toby Inkster <firstname.lastname@example.org>.
This software is copyright (c) 2013 by Toby Inkster.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.