Type::Coercion - a set of coercions to a particular target type constraint
new(%attributes)
Moose-style constructor function.
type_constraint
Weak reference to the target type constraint (i.e. the type constraint which the output of coercion coderefs is expected to conform to).
type_coercion_map
Arrayref of source-type/coercion-coderef pairs. Don't set this in the constructor; use the add_type_coercions method instead.
add_type_coercions
moose_coercion
A Moose::Meta::TypeCoercion object equivalent to this one. Don't set this manually; rely on the default built one.
has_type_constraint
Predicate method.
add_type_coercions($type1, $code1, ...)
Takes one or more pairs of Type::Tiny objects and coderefs, creating an ordered list of source types and coercion coderefs.
coerce($value)
Coerce the value to the target type.
assert_coerce($value)
Coerce the value to the target type, and throw an exception if the result does not validate against the target type constraint.
has_coercion_for_type($source_type)
Not implemented yet.
has_coercion_for_value($value)
Returns true iff the value could be coerced by this coercion.
Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=Type-Tiny.
Type::Tiny::Manual.
Type::Tiny, Type::Library, Type::Utils, Type::Standard.
Moose::Meta::TypeCoercion.
Toby Inkster <tobyink@cpan.org>.
This software is copyright (c) 2013 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
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.
To install Type::Tiny, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Type::Tiny
CPAN shell
perl -MCPAN -e shell install Type::Tiny
For more information on module installation, please visit the detailed CPAN module installation guide.