X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FRole.pm;h=734bebe0d9feb7693d4a1f755d7e52da95f3bfd4;hp=78e01a42e4c8b191b0b28822ac66557a7f4350ca;hb=ba33632ecfa5155f2bbb3b1b77e4d03c6895adb4;hpb=20b968ddc012f8ec15bc07fb808446a94665cb64 diff --git a/lib/Mouse/Meta/Role.pm b/lib/Mouse/Meta/Role.pm index 78e01a4..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,8 +50,8 @@ 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); } }