From: Arthur Axel 'fREW' Schmidt Date: Wed, 10 Nov 2010 04:07:25 +0000 (-0600) Subject: Documentation for Moo::Role X-Git-Tag: 0.009001~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bce933ec0919eecc8b47551a27cd06ce33ddbc1f;p=gitmo%2FRole-Tiny.git Documentation for Moo::Role --- diff --git a/lib/Moo/Role.pm b/lib/Moo/Role.pm index c27c025..a8af3cf 100644 --- a/lib/Moo/Role.pm +++ b/lib/Moo/Role.pm @@ -72,3 +72,54 @@ sub _handle_constructor { } 1; + +=pod + +=head1 SYNOPSIS + + package My::Role; + + use Moo::Role; + + sub foo { ... } + + sub bar { ... } + + has baz => ( + is => 'ro', + ); + + 1; + +else where + + package Some::Class; + + use Moo; + + # bar gets imported, but not foo + with('My::Role'); + + sub foo { ... } + + 1; + +=head1 DESCRIPTION + +C builds upon L, so look there for most of the +documentation on how this works. The main addition here is extra bits to make +the roles more "Moosey;" which is to say, it adds L. + +=head1 IMPORTED SUBROUTINES + +See L for all the other subroutines that are +imported by this module. + +=head2 has + + has attr => ( + is => 'ro', + ); + +Declares an attribute for the class to be composed into. See +L for all options.