From: Christian Walde Date: Mon, 16 Apr 2012 15:37:14 +0000 (+0200) Subject: changed order of documentation to make it easier to read for newcomers X-Git-Tag: v1.001000~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ec28e16b79cfdbe072e70897dc3d4e0bfed5edec;p=gitmo%2FRole-Tiny.git changed order of documentation to make it easier to read for newcomers --- diff --git a/lib/Role/Tiny.pm b/lib/Role/Tiny.pm index 0a38650..5ecbe23 100644 --- a/lib/Role/Tiny.pm +++ b/lib/Role/Tiny.pm @@ -364,49 +364,6 @@ are applied in a single call (single with statement), then if any of their provided methods clash, an exception is raised unless the class provides a method since this conflict indicates a potential problem. -=head1 METHODS - -=head2 apply_roles_to_package - - Role::Tiny->apply_roles_to_package( - 'Some::Package', 'Some::Role', 'Some::Other::Role' - ); - -Composes role with package. See also L. - -=head2 apply_roles_to_object - - Role::Tiny->apply_roles_to_object($foo, qw(Some::Role1 Some::Role2)); - -Composes roles in order into object directly. Object is reblessed into the -resulting class. - -=head2 create_class_with_roles - - Role::Tiny->create_class_with_roles('Some::Base', qw(Some::Role1 Some::Role2)); - -Creates a new class based on base, with the roles composed into it in order. -New class is returned. - -=head1 SUBROUTINES - -=head2 does_role - - if (Role::Tiny::does_role($foo, 'Some::Role')) { - ... - } - -Returns true if class has been composed with role. - -This subroutine is also installed as ->does on any class a Role::Tiny is -composed into unless that class already has an ->does method, so - - if ($foo->does('Some::Role')) { - ... - } - -will work for classes but to test a role, one must use ::does_role directly - =head1 IMPORTED SUBROUTINES =head2 requires @@ -468,6 +425,49 @@ L is lazily loaded and we do not declare it as a dependency. If your L role uses modifiers you must depend on both L and L. +=head1 SUBROUTINES + +=head2 does_role + + if (Role::Tiny::does_role($foo, 'Some::Role')) { + ... + } + +Returns true if class has been composed with role. + +This subroutine is also installed as ->does on any class a Role::Tiny is +composed into unless that class already has an ->does method, so + + if ($foo->does('Some::Role')) { + ... + } + +will work for classes but to test a role, one must use ::does_role directly + +=head1 METHODS + +=head2 apply_roles_to_package + + Role::Tiny->apply_roles_to_package( + 'Some::Package', 'Some::Role', 'Some::Other::Role' + ); + +Composes role with package. See also L. + +=head2 apply_roles_to_object + + Role::Tiny->apply_roles_to_object($foo, qw(Some::Role1 Some::Role2)); + +Composes roles in order into object directly. Object is reblessed into the +resulting class. + +=head2 create_class_with_roles + + Role::Tiny->create_class_with_roles('Some::Base', qw(Some::Role1 Some::Role2)); + +Creates a new class based on base, with the roles composed into it in order. +New class is returned. + =head1 SEE ALSO L is the attribute-less subset of L; L is @@ -504,6 +504,8 @@ doy - Jesse Luehrs (cpan:DOY) perigrin - Chris Prather (cpan:PERIGRIN) +Mithaldu - Christian Walde (cpan:MITHALDU) + =head1 COPYRIGHT Copyright (c) 2010-2012 the Role::Tiny L and L