This will attempt to use coercion with the supplied type constraint to change
the value passed into any accessors or constructors. You B<must> supply a type
constraint, and that type constraint B<must> define a coercion. See
-L<Moose::Cookbook::Basics::Recipe5> for an example.
+L<Moose::Cookbook::Basics::HTTP_SubtypesAndCoercion> for an example.
=item I<does =E<gt> $role_name>
use of C<override> in a subclass. This recipe also shows how to model a set of
classes that could be used to model companies, people, employees, etc.
-=item L<Moose::Cookbook::Basics::Recipe5> - More subtypes, coercion in a B<Request> class
+=item L<Moose::Cookbook::Basics::HTTP_SubtypesAndCoercion>
-More type examples, including the use of type coercions.
+This recipe covers more subtype creation, including the use of type coercions.
=item L<Moose::Cookbook::Basics::Recipe6> - The augment/inner example
-package Moose::Cookbook::Basics::Recipe5;
+package Moose::Cookbook::Basics::HTTP_SubtypesAndCoercion;
-# ABSTRACT: More subtypes, coercion in a B<Request> class
+# ABSTRACT: Demonstrates subtypes and coercion use HTTP-related classes (Request, Protocol, etc.)
__END__
pairs or a hash reference. You can override it to take positional
args, or any other format
-To change the handling of individual parameters, there are
-I<coercions> (See the L<Moose::Cookbook::Basics::Recipe5> for a
-complete example and explanation of coercions). With coercions it is
-possible to morph argument values into the correct expected
-types. This approach is the most flexible and robust, but does have a
-slightly higher learning curve.
+To change the handling of individual parameters, there are I<coercions> (See
+the L<Moose::Cookbook::Basics::HTTP_SubtypesAndCoercion> for a complete
+example and explanation of coercions). With coercions it is possible to morph
+argument values into the correct expected types. This approach is the most
+flexible and robust, but does have a slightly higher learning curve.
=head3 How do I make non-Moose constructors work with Moose?
in the C<via> block.
For a more comprehensive example of using coercions, see the
-L<Moose::Cookbook::Basics::Recipe5>.
+L<Moose::Cookbook::Basics::HTTP_SubtypesAndCoercion>.
If you need to deflate your attribute's value, the current best
practice is to add an C<around> modifier to your accessor: