X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FManual%2FMooseX.pod;h=c47d15fe3b5da8f28dbab3f08b5b7315850b3a21;hb=c40e4359e7a5ad21af41e42c5a3746c193da9777;hp=8327e134b392533dceedc321cc9da52099746a70;hpb=cc7dafef836f7f5a462614fae917380a48f49062;p=gitmo%2FMoose.git diff --git a/lib/Moose/Manual/MooseX.pod b/lib/Moose/Manual/MooseX.pod index 8327e13..c47d15f 100644 --- a/lib/Moose/Manual/MooseX.pod +++ b/lib/Moose/Manual/MooseX.pod @@ -1,8 +1,10 @@ -=pod +package Moose::Manual::MooseX; + +# ABSTRACT: Recommended Moose extensions -=head1 NAME +__END__ -Moose::Manual::MooseX - Recommended Moose extensions +=pod =head1 MooseX? @@ -23,31 +25,8 @@ This document covers a few of the ones we like best. =head1 L -If you only look at one extension, it should be this one. It provides -the equivalent of delegation for all of Perl's native data types, such -as array reference, hash references, numbers, strings, etc. - -This lets you create I cleaner and fluent APIs. - - package User; - - use Moose; - use MooseX::AttributeHelpers; - - has '_orders' => ( - metaclass => 'Collection::Array', - is => 'ro', - isa => 'ArrayRef', - default => sub { [] }, - provides => { - push => 'add_order', - shift => 'next_order', - elements => 'orders', - }, - ); - -Instead of directly exposing an array reference, we have three -well-named, easy to use methods. +The functionality of this MooseX module has been moved into Moose core. +See L. =head1 L @@ -191,10 +170,10 @@ also lets you predeclare type names and use them as barewords. use MooseX::Types -declare => ['PositiveInt']; use MooseX::Types::Moose 'Int'; - subtype PositiveInt - => as Int, - => where { $_ > 0 } - => message {"Int is not larger than 0"}; + subtype PositiveInt, + as Int, + where { $_ > 0 }, + message { "Int is not larger than 0" }; One nice feature is that those bareword names are actually namespaced in Moose's type registry, so multiple applications can use the same @@ -233,7 +212,7 @@ attributes. class_has 'Cache' => ( ... ); -Note however that this class attribute does -not- inherit like a +Note however that this class attribute does I inherit like a L or similar attribute - calling $subclass->Cache($cache); @@ -280,17 +259,4 @@ setting up proper inheritance from Moose::Object and installing (and inlining, at make_immutable time) a constructor that makes sure things like BUILD methods are called. -=head1 AUTHOR - -Dave Rolsky Eautarch@urth.orgE - -=head1 COPYRIGHT AND LICENSE - -Copyright 2009 by Infinity Interactive, Inc. - -L - -This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. - =cut