From: Dave Rolsky Date: Thu, 12 Feb 2009 17:03:14 +0000 (+0000) Subject: Revise extending recipe 4 X-Git-Tag: 0.69~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c09fae0b7bca054129610e7c22e740a8769463d3;p=gitmo%2FMoose.git Revise extending recipe 4 --- diff --git a/lib/Moose/Cookbook/Extending/Recipe4.pod b/lib/Moose/Cookbook/Extending/Recipe4.pod index 1f046ab..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,6 +69,11 @@ 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