use B 'perlstring';
use Sub::Defer ();
-our $VERSION = '1.000001'; # 1.0.1
+our $VERSION = '1.000005'; # 1.0.5
$VERSION = eval $VERSION;
require Moo::sification;
$class->_maybe_reset_handlemoose($target);
};
_install_tracked $target => has => sub {
- my ($name, %spec) = @_;
- $class->_constructor_maker_for($target)
- ->register_attribute_specs($name, \%spec);
- $class->_accessor_maker_for($target)
- ->generate_method($target, $name, \%spec);
- $class->_maybe_reset_handlemoose($target);
+ my ($name_proto, %spec) = @_;
+ my $name_isref = ref $name_proto eq 'ARRAY';
+ foreach my $name ($name_isref ? @$name_proto : $name_proto) {
+ # Note that when $name_proto is an arrayref, each attribute
+ # needs a separate \%specs hashref
+ my $spec_ref = $name_isref ? +{%spec} : \%spec;
+ $class->_constructor_maker_for($target)
+ ->register_attribute_specs($name, $spec_ref);
+ $class->_accessor_maker_for($target)
+ ->generate_method($target, $name, $spec_ref);
+ $class->_maybe_reset_handlemoose($target);
+ }
return;
};
foreach my $type (qw(before after around)) {
sub _set_superclasses {
my $class = shift;
my $target = shift;
- for (@_) {
- _load_module($_);
- if ($INC{"Role/Tiny.pm"} && $Role::Tiny::INFO{$_}) {
+ foreach my $superclass (@_) {
+ _load_module($superclass);
+ if ($INC{"Role/Tiny.pm"} && $Role::Tiny::INFO{$superclass}) {
require Carp;
- Carp::croak("Can't extend role '$_'");
+ Carp::croak("Can't extend role '$superclass'");
}
}
# Can't do *{...} = \@_ or 5.10.0's mro.pm stops seeing @ISA
Unlike L<Mouse> this module does not aim at full compatibility with
L<Moose>'s surface syntax, preferring instead of provide full interoperability
-via the metaclass inflation capabilites described in L</MOO AND MOOSE>.
+via the metaclass inflation capabilities described in L</MOO AND MOOSE>.
For a full list of the minor differences between L<Moose> and L<Moo>'s surface
-syntax, see L</INCOMPATIBILITIES>.
+syntax, see L</INCOMPATIBILITIES WITH MOOSE>.
=head1 WHY MOO EXISTS
ilmari - Dagfinn Ilmari Mannsåker (cpan:ILMARI) <ilmari@ilmari.org>
+tobyink - Toby Inkster (cpan:TOBYINK) <tobyink@cpan.org>
+
=head1 COPYRIGHT
Copyright (c) 2010-2011 the Moo L</AUTHOR> and L</CONTRIBUTORS>