Add missing comma in Extending::Recipe1 example
[gitmo/Moose.git] / lib / Moose / Cookbook / Extending / Recipe1.pod
index c81b1a8..0f79a8c 100644 (file)
@@ -1,9 +1,11 @@
+package Moose::Cookbook::Extending::Recipe1;
 
-=pod
+# ABSTRACT: Moose extension overview
+
+__END__
 
-=head1 NAME
 
-Moose::Cookbook::Extending::Recipe1 - Moose extension overview
+=pod
 
 =head1 DESCRIPTION
 
@@ -46,6 +48,8 @@ Many of the Moose extensions on CPAN work by providing an attribute
 metaclass extension. For example, the L<MooseX::AttributeHelpers>
 distribution provides a new attribute metaclass that lets you delegate
 behavior to a non-object attribute (a hashref or simple number).
+(MooseX::AttributeHelpers has been deprecated in favour of
+L<Moose::Meta::Attribute::Native>, but can still serve as an example).
 
 A metaclass extension can be packaged as a subclass or a
 role/trait. If you can, we recommend using traits instead of
@@ -225,14 +229,14 @@ directly; see the L<Moose::Exporter> docs.
   use MooseX::Embiggen::Role::Meta::Method::Constructor;
   use MooseX::Embiggen::Role::Object;
 
-  my ($import, $unimport, $init_meta) = Moose::Exporter->build_import_methods(
-      also                      => ['Moose']
-      metaclass_roles           => ['MooseX::Embiggen::Role::Meta::Class'],
+  my ( $import, $unimport, $init_meta ) = Moose::Exporter->build_import_methods(
+      also => ['Moose'], metaclass_roles =>
+          ['MooseX::Embiggen::Role::Meta::Class'],
       attribute_metaclass_roles => ['MooseX::Embiggen::Role::Meta::Attribute'],
-      constructor_class_roles   =>
+      constructor_class_roles =>
           ['MooseX::Embiggen::Role::Meta::Method::Constructor'],
-      base_class_roles          => ['MooseX::Embiggen::Role::Object'],
-      install                   => [qw(import unimport)],
+      base_class_roles => ['MooseX::Embiggen::Role::Object'],
+      install          => [qw(import unimport)],
   );
 
   sub init_meta {
@@ -258,13 +262,13 @@ as well as those from other modules:
   use Moose::Exporter;
 
   Moose::Exporter->setup_import_methods(
-      with_caller => ['embiggen'],
-      also        => 'Moose',
+      with_meta => ['embiggen'],
+      also      => 'Moose',
   );
 
   sub embiggen {
-      my $caller = shift;
-      $caller->meta()->embiggen(@_);
+      my $meta = shift;
+      $meta->embiggen(@_);
   }
 
 And then the consumer of your extension can use your C<embiggen> sub:
@@ -301,17 +305,4 @@ If you can write your extension as one or more metaclass and base
 object roles, please consider doing so. Make sure to read the docs for
 L<Moose::Exporter> and L<Moose::Util::MetaRole> as well.
 
-=head1 AUTHOR
-
-Dave Rolsky E<lt>autarch@urth.orgE<gt>
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright 2009 by Infinity Interactive, Inc.
-
-L<http://www.iinteractive.com>
-
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
 =cut