package Mouse::Role;
use Mouse::Exporter; # enables strict and warnings
-our $VERSION = '0.52';
+our $VERSION = '0.71';
use Carp qw(confess);
use Scalar::Util qw(blessed);
Carp::croak "Roles do not support 'extends'";
}
-sub with {
- my $meta = Mouse::Meta::Role->initialize(scalar caller);
- Mouse::Util::apply_all_roles($meta->name, @_);
+sub with {
+ Mouse::Util::apply_all_roles(scalar(caller), @_);
return;
}
$meta->throw_error(q{Usage: has 'name' => ( key => value, ... )})
if @_ % 2; # odd number of arguments
- if(ref $name){ # has [qw(foo bar)] => (...)
- for (@{$name}){
- $meta->add_attribute($_ => @_);
- }
- }
- else{ # has foo => (...)
- $meta->add_attribute($name => @_);
+ for my $n(ref($name) ? @{$name} : $name){
+ $meta->add_attribute($n => @_);
}
return;
}
=head1 VERSION
-This document describes Mouse version 0.52
+This document describes Mouse version 0.71
=head1 SYNOPSIS