X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FManual%2FRoles.pod;h=88d94d8a04863c8da7f88ac79fdbdd7eff3393a1;hb=c24269b37a781e0358c3682e8717cfd539269550;hp=b1e45b7b30fcdd3dcf4096f090a1eb5cd07a1aa3;hpb=c89a5d69d49ca4a7850adf01125219e8ee412836;p=gitmo%2FMoose.git diff --git a/lib/Moose/Manual/Roles.pod b/lib/Moose/Manual/Roles.pod index b1e45b7..88d94d8 100644 --- a/lib/Moose/Manual/Roles.pod +++ b/lib/Moose/Manual/Roles.pod @@ -153,8 +153,8 @@ set to true when C is called. If you are familiar with the concept of abstract base classes in other languages, you may be tempted to use roles in the same way. -You I define a "interface-only" role, one that contains I a -list of required methods. +You I define an "interface-only" role, one that contains I +a list of required methods. However, any class which consumes this role must implement all of the required methods, either directly or through inheritance from a @@ -196,7 +196,7 @@ If a class composes multiple roles, and those roles have methods of the same name, we will have a conflict. In that case, the composing class is required to provide its I method of the same name. - package Breakdances; + package Breakdancer; use Moose::Role @@ -231,15 +231,15 @@ However, aliasing a method simply makes a I of the method with the new name. We also need to exclude the original name: with 'Breakable' => { - alias => { break => 'break_bone' }, - exclude => 'break', + alias => { break => 'break_bone' }, + excludes => 'break', }, 'Breakdancer' => { - alias => { break => 'break_dance' }, - exclude => 'break', + alias => { break => 'break_dance' }, + excludes => 'break', }; -The exclude parameter prevents the C method from being composed +The excludes parameter prevents the C method from being composed into the C class, so we don't have a conflict. This means that C does not need to implement its own C method.