X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FRole%2FComposite.pm;h=9f0aaac512dff16c1991dfc2ad35f6afbb6326c7;hb=92d8204181e20d7b6a0144fca0a99095a7788ff4;hp=28a4ddab210196dc2c04ac80663ffbf4da8f7d63;hpb=a532c4ac93ebdcbd09cd455dbb49caf8a7de1912;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Role/Composite.pm b/lib/Moose/Meta/Role/Composite.pm index 28a4dda..9f0aaac 100644 --- a/lib/Moose/Meta/Role/Composite.pm +++ b/lib/Moose/Meta/Role/Composite.pm @@ -6,24 +6,24 @@ use metaclass; use Scalar::Util 'blessed'; -our $VERSION = '0.71_01'; +our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; use base 'Moose::Meta::Role'; # NOTE: -# we need to override the ->name +# we need to override the ->name # method from Class::MOP::Package -# since we don't have an actual +# since we don't have an actual # package for this. # - SL __PACKAGE__->meta->add_attribute('name' => (reader => 'name')); # NOTE: -# Again, since we don't have a real -# package to store our methods in, -# we use a HASH ref instead. +# Again, since we don't have a real +# package to store our methods in, +# we use a HASH ref instead. # - SL __PACKAGE__->meta->add_attribute('methods' => ( reader => 'get_method_map', @@ -62,7 +62,7 @@ sub add_method { if ($method->package_name ne $self->name) { $method = $method->clone( package_name => $self->name, - name => $method_name + name => $method_name ) if $method->can('clone'); } } @@ -86,19 +86,36 @@ Moose::Meta::Role::Composite - An object to represent the set of roles =head1 DESCRIPTION +A composite is a role that consists of a set of two or more roles. + +The API of a composite role is almost identical to that of a regular +role. + +=head1 INHERITANCE + +C is a subclass of L. + =head2 METHODS =over 4 -=item B +=item B<< Moose::Meta::Role::Composite->new(%options) >> -=item B +This returns a new composite role object. It accepts the same +options as its parent class, with a few changes: -=item B +=over 8 -=item B +=item * roles -=item B +This option is an array reference containing a list of +L object. This is a required option. + +=item * name + +If a name is not given, one is generated from the roles provided. + +=back =back