X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FAttribute.pm;h=10a94502366c8afdd9eeb37ed0ac6fe215a67b03;hp=cc43a3711fe3a3f38f5cb050f0b90c0a4b896603;hb=431e4817af5380b349d562cafde91777db982a2a;hpb=d990f7911dfd6a36d1dcc072e7adb72bf0379349 diff --git a/lib/Mouse/Meta/Attribute.pm b/lib/Mouse/Meta/Attribute.pm index cc43a37..10a9450 100644 --- a/lib/Mouse/Meta/Attribute.pm +++ b/lib/Mouse/Meta/Attribute.pm @@ -44,6 +44,8 @@ my %valid_options = map { $_ => undef } ( 'curries', ); +our @CARP_NOT = qw(Mouse::Meta::Class); + sub new { my $class = shift; my $name = shift; @@ -76,8 +78,9 @@ sub new { # (3) bad options found if(@bad){ - @bad = sort @bad; - Carp::cluck("Found unknown argument(s) passed to '$name' attribute constructor in '$class': @bad"); + Carp::carp( + "Found unknown argument(s) passed to '$name' attribute constructor in '$class': " + . Mouse::Util::english_list(@bad)); } my $self = bless $args, $class; @@ -372,13 +375,8 @@ sub _canonicalize_handles { sub _make_delegation_method { my($self, $handle, $method_to_call) = @_; - my $delegator = $self->delegation_metaclass; - Mouse::Util::load_class($delegator); - - return $delegator->_generate_delegation($self, $handle, - ref($method_to_call) eq 'ARRAY' - ? @{$method_to_call} - : $method_to_call); + return Mouse::Util::load_class($self->delegation_metaclass) + ->_generate_delegation($self, $handle, $method_to_call); } sub throw_error{ @@ -397,7 +395,7 @@ Mouse::Meta::Attribute - The Mouse attribute metaclass =head1 VERSION -This document describes Mouse version 0.50_02 +This document describes Mouse version 0.50_03 =head1 METHODS