This will attempt to use coercion with the supplied type constraint to change
the value passed into any accessors or constructors. You B<must> have supplied
-a type constraint in order for this to work. See L<Moose::Cookbook::Recipe5>
+a type constraint in order for this to work. See L<Moose::Cookbook::Basics::Recipe5>
for an example.
=item I<does =E<gt> $role_name>
in the class being delegated to.
This can be very useful for recursive classes like trees. Here is a
-quick example (soon to be expanded into a Moose::Cookbook::Recipe):
+quick example (soon to be expanded into a Moose::Cookbook recipe):
package Tree;
use Moose;
attribute. Custom attribute metaclasses are useful for extending the
capabilities of the I<has> keyword: they are the simplest way to extend the MOP,
but they are still a fairly advanced topic and too much to cover here, see
-L<Moose::Cookbook::Recipe11> for more information.
+L<Moose::Cookbook::Meta::Recipe1> for more information.
The default behavior here is to just load C<$metaclass_name>; however, we also
have a way to alias to a shorter name. This will first look to see if
The keyword C<inner>, much like C<super>, is a no-op outside of the context of
an C<augment> method. You can think of C<inner> as being the inverse of
C<super>; the details of how C<inner> and C<augment> work is best described in
-the L<Moose::Cookbook::Recipe6>.
+the L<Moose::Cookbook::Basics::Recipe6>.
=item B<augment ($name, &sub)>
An C<augment> method, is a way of explicitly saying "I am augmenting this
method from my superclass". Once again, the details of how C<inner> and
-C<augment> work is best described in the L<Moose::Cookbook::Recipe6>.
+C<augment> work is best described in the L<Moose::Cookbook::Basics::Recipe6>.
=item B<confess>
Demonstrates several attribute features, including types, weak
references, predicates ("does this object have a foo?"), defaults, and
-lazy attribute construction.
+lazy attribute uction.
=item L<Moose::Cookbook::Basics::Recipe4> - Subtypes, and modeling a simple B<Company> class hierarchy
I<abstract goes here>
-=item L<Moose::Cookbook::Recipe24> - The meta-class example (TODO)
+=item L<Moose::Cookbook::Meta::Recipe5> - The meta-class example (TODO)
I<abstract goes here>
or any other format
To change the handling of individual parameters, there are I<coercions>
-(See the L<Moose::Cookbook::Recipe5> for a complete example and
+(See the L<Moose::Cookbook::Basics::Recipe5> for a complete example and
explaination 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
in the C<via> block.
For a more comprehensive example of using coercions, see the
-L<Moose::Cookbook::Recipe5>.
+L<Moose::Cookbook::Basics::Recipe5>.
If you need to deflate your attribute, the current best practice is to
add an C<around> modifier to your accessor. Here is some example code:
=head1 DESCRIPTION
-This is the Point example from (L<Moose::Cookbook::Recipe1>) with added
+This is the Point example from (L<Moose::Cookbook::Basics::Recipe1>) with added
type checking.
If we try to assign a string value to an attribute that is defined as
=over 4
-=item L<Moose::Cookbook::Recipe1>
+=item L<Moose::Cookbook::Basics::Recipe1>
=item L<Moose::Utils::TypeConstraints>
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
-=cut
\ No newline at end of file
+=cut
To check a value against a type constraint before setting it, fetch the
attribute instance using L<Class::MOP::Class/find_attribute_by_name>,
fetch the type_constraint from the attribute using L<Moose::Meta::Attribute/type_constraint>
-and call L<Moose::Meta::TypeConstraint/check>. See L<Moose::Cookbook::RecipeX>
+and call L<Moose::Meta::TypeConstraint/check>. See L<Moose::Cookbook::Basics::Recipe4>
for an example.
=back
=head1 DESCRIPTION
This metaclass represents a union of Moose type constraints. More
-details to be explained later (possibly in a Cookbook::Recipe).
+details to be explained later (possibly in a Cookbook recipe).
This actually used to be part of Moose::Meta::TypeConstraint, but it
is now better off in it's own file.