X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FCookbook.pod;h=8ed5962dc88bb14170b81ea395cea578000e6e9a;hb=51569ca65d64b0b9add61f6faeb8836caf54093b;hp=5b1cabde518e5c629f81658600f00550b4d5323b;hpb=ad248e00365db1ee7daec8862d7e3e2c1d6d7192;p=gitmo%2FMoose.git diff --git a/lib/Moose/Cookbook.pod b/lib/Moose/Cookbook.pod index 5b1cabd..8ed5962 100644 --- a/lib/Moose/Cookbook.pod +++ b/lib/Moose/Cookbook.pod @@ -27,7 +27,7 @@ modifiers, and more. =item L - The (always classic) B example -A simple Moose-based class. Demonstrated Moose attributes and subclassing. +A simple Moose-based class. Demonstrates Moose attributes and subclassing. =item L - A simple B example @@ -37,8 +37,8 @@ modifier in a subclass. =item L - A lazy B example Demonstrates several attribute features, including types, weak -references, predicates ("does this object have a foo?"), defaults, and -lazy attribute construction. +references, predicates ("does this object have a foo?"), defaults, +laziness, and triggers. =item L - Subtypes, and modeling a simple B class hierarchy @@ -75,9 +75,10 @@ provide a default attribute value. Demonstrates using operator overloading, coercion, and subtypes to model how eye color is determined during reproduction. -=item L - BUILD and BUILDARGS (TODO) +=item L - Using BUILDARGS and BUILD to hook into object construction -We need a good recipe demonstrating how these work. +This recipe demonstrates the use of C and C to hook +into object construction. =back @@ -96,20 +97,20 @@ subclassing. =item L - Advanced Role Composition - method exclusion and aliasing Sometimes you just want to include part of a role in your -class. Sometimes you want the whole role but one if its methods +class. Sometimes you want the whole role but one of its methods conflicts with one in your class. With method exclusion and aliasing, you can work around these problems. -=item L - Runtime Role Composition (TODO) +=item L - Applying a role to an object instance -I +In this recipe, we apply a role to an existing object instance. =back =head2 Meta Moose These recipes show you how to write your own meta classes, which lets -you extend the object system provide by Moose. +you extend the object system provided by Moose. =over 4 @@ -141,10 +142,21 @@ L as well. =item L - The "table" attribute implemented as a metaclass trait -This example takes the class metaclass we saw in the previous recipe +This recipe takes the class metaclass we saw in the previous recipe and reimplements it as a metaclass trait. -=item L - Hooking into the immutabilization system (TODO) +=item L - A method metaclass for marking methods public or private + +This recipe shows a custom method metaclass that implements making a +method private. + +=item L - Using a blessed array reference as an object instance + +This recipe shows an example of how you create your own meta-instance +class. The meta-instance determines the internal structure of object +instances and provide access to attribute slots. + +=item L - Hooking into immutabilization (TODO) Moose has a feature known as "immutabilization". By calling C<< __PACKAGE__->meta()->make_immutable() >> after defining your class @@ -159,10 +171,6 @@ meta-instance class as well. This recipe shows you how to write extensions which immutabilize properly. -=item L - I (TODO) - -I - =back =head2 Extending Moose @@ -174,9 +182,9 @@ if you plan to write your own C module. =item L - Moose extension overview -There are quite a number of ways to extend Moose. This recipe explains -provides an overview of each method, and provides recommendations for -when each is appropriate. +There are quite a few ways to extend Moose. This recipe provides an +overview of each method, and provides recommendations for when each is +appropriate. =item L - Providing a base object class role