X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FCookbook%2FExtending%2FRecipe4.pod;h=6ca5cd102baeecbad00d669cde730493cad030c5;hb=eec1183467e5fc6f53c59350ab69ec514c7b0260;hp=a6b9c3f55819a03a0542773a7418cad31cf05f85;hpb=c8d5f1e1afb0a13f2a0d66b55f7fa550e4b38d1d;p=gitmo%2FMoose.git diff --git a/lib/Moose/Cookbook/Extending/Recipe4.pod b/lib/Moose/Cookbook/Extending/Recipe4.pod index a6b9c3f..6ca5cd1 100644 --- a/lib/Moose/Cookbook/Extending/Recipe4.pod +++ b/lib/Moose/Cookbook/Extending/Recipe4.pod @@ -27,7 +27,7 @@ Moose::Cookbook::Extending::Recipe4 - Acting like Moose.pm and providing sugar M sub has_table { my $caller = shift; - $caller->meta()->table(shift); + $caller->meta->table(shift); } =head1 DESCRIPTION @@ -35,7 +35,7 @@ Moose::Cookbook::Extending::Recipe4 - Acting like Moose.pm and providing sugar M This recipe expands on the use of L we saw in L. Instead of providing our own object base class, we provide our own metaclass class, and we also -export a sugar subroutine C. +export a C sugar function. Given the above code, you can now replace all instances of C with C. Similarly, C is now @@ -69,13 +69,18 @@ interface. Here's what it would look like in actual use: All of the normal Moose sugar (C, C, etc) is available when you C. +=head1 CONCLUSION + +Providing sugar functions can make your extension look much more +Moose-ish. See L for a more extensive example. + =head1 AUTHOR Dave Rolsky Eautarch@urth.orgE =head1 COPYRIGHT AND LICENSE -Copyright 2006-2008 by Infinity Interactive, Inc. +Copyright 2006-2009 by Infinity Interactive, Inc. L