X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FRole.pm;h=734bebe0d9feb7693d4a1f755d7e52da95f3bfd4;hb=ba33632ecfa5155f2bbb3b1b77e4d03c6895adb4;hp=3c7aff1288849bf3acc3c3a23a150de6b21d906a;hpb=274b6ccef8d4b5faa062ca38d7207617fc1cd51f;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Role.pm b/lib/Mouse/Meta/Role.pm index 3c7aff1..734bebe 100644 --- a/lib/Mouse/Meta/Role.pm +++ b/lib/Mouse/Meta/Role.pm @@ -42,7 +42,7 @@ sub add_attribute { sub has_attribute { exists $_[0]->{attributes}->{$_[1]} } sub get_attribute_list { keys %{ $_[0]->{attributes} } } -sub get_attribute { @{ $_->[0]->{attributes}->{$_[1]} || [] } } +sub get_attribute { $_->[0]->{attributes}->{$_[1]} } sub apply { my $self = shift; @@ -50,10 +50,9 @@ sub apply { my $pkg = $class->name; for my $name ($self->get_attribute_list) { - my @spec = $self->get_attribute($name); - Mouse::Meta::Attribute->create($pkg, $name, @spec); + my $spec = $self->get_attribute($name); + Mouse::Meta::Attribute->create($pkg, $name, @$spec); } - } 1;