From: Shawn M Moore Date: Tue, 17 Jun 2008 03:43:59 +0000 (+0000) Subject: Implement "with" but no role application quite yet X-Git-Tag: 0.19~300 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3ab0ee8f8aaf8eecb7843ddeab1d464c90b2872d;p=gitmo%2FMouse.git Implement "with" but no role application quite yet --- diff --git a/lib/Mouse.pm b/lib/Mouse.pm index ae3a0b7..cb525f0 100644 --- a/lib/Mouse.pm +++ b/lib/Mouse.pm @@ -68,6 +68,18 @@ do { around => sub { return \&Class::Method::Modifiers::around; }, + + with => sub { + my $caller = $CALLER; + + return sub { + my $role = shift; + my $class = $caller->meta; + + Mouse::load_class($role); + $role->apply_to_class($class); + }; + }, ); my $exporter = Sub::Exporter::build_exporter({