X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse.pm;h=1f1e3866398e7e809b90c41fd2dd6b305120ee10;hb=a02698f11a62bdf881c1a00651c2426b95095b29;hp=ae3a0b7a709eec4241b0c8e6afa4f26e70a1a4d6;hpb=6af45c5e08220ae5a1577d8cfed568bcb7b081f8;p=gitmo%2FMouse.git diff --git a/lib/Mouse.pm b/lib/Mouse.pm index ae3a0b7..1f1e386 100644 --- a/lib/Mouse.pm +++ b/lib/Mouse.pm @@ -68,6 +68,20 @@ do { around => sub { return \&Class::Method::Modifiers::around; }, + + with => sub { + my $caller = $CALLER; + + return sub { + my $role = shift; + my $class = $caller->meta; + + confess "Mouse::Role only supports 'with' on individual roles at a time" if @_; + + Mouse::load_class($role); + $role->meta->apply($class); + }; + }, ); my $exporter = Sub::Exporter::build_exporter({