From: Shawn M Moore Date: Sat, 30 May 2009 18:46:47 +0000 (-0400) Subject: Make Role::Method::Required its own entity, since it is not actually a X-Git-Tag: 0.80~53 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2cf88ade9c9c6a6751717a7eb3b4e8b721d17f69;p=gitmo%2FMoose.git Make Role::Method::Required its own entity, since it is not actually a subclass of Role::Method --- diff --git a/lib/Moose/Meta/Role/Method/Required.pm b/lib/Moose/Meta/Role/Method/Required.pm index 8d8df5f..70e2186 100644 --- a/lib/Moose/Meta/Role/Method/Required.pm +++ b/lib/Moose/Meta/Role/Method/Required.pm @@ -3,12 +3,21 @@ package Moose::Meta::Role::Method::Required; use strict; use warnings; +use metaclass; + +use overload '""' => sub { shift->name }, # stringify to method name + fallback => 1; + +use base qw(Class::MOP::Object); our $VERSION = '0.79'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -use base 'Moose::Meta::Role::Method'; +# This is not a Moose::Meta::Role::Method because it has no implementation, it +# is just a name + +__PACKAGE__->meta->add_attribute('name' => (reader => 'name')); 1;