From: Matt S Trout Date: Sun, 14 Nov 2010 19:28:24 +0000 (+0000) Subject: clean up does_role docs X-Git-Tag: 0.009001~11 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=54e4000ddb660224fc98f64adcea26413bfae2d5;p=gitmo%2FMoo.git clean up does_role docs --- diff --git a/lib/Role/Tiny.pm b/lib/Role/Tiny.pm index 93d2a7f..534db17 100644 --- a/lib/Role/Tiny.pm +++ b/lib/Role/Tiny.pm @@ -297,16 +297,25 @@ resulting class. Creates a new class based on base, with the roles composed into it in order. New class is returned. -=head1 IMPORTED METHODS +=head1 SUBROUTINES =head2 does_role - if ($foo->does_role('Some::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_role('Some::Role')) { + ... + } + +will work for classes but to test a role, one must use ::does_role directly + =head1 IMPORTED SUBROUTINES =head2 requires