use Scalar::Util 'blessed';
use Class::MOP 0.60;
-our $VERSION = '0.93_03';
+our $VERSION = '1.05';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
$meta = $role->[0];
}
else {
- Class::MOP::load_class( $role->[0] );
+ Class::MOP::load_class( $role->[0] , $role->[1] );
$meta = Class::MOP::class_of( $role->[0] );
}
$meta->$add_modifier_method( $_->name, $code )
for @matched_methods;
}
+ elsif ($method_modifier_type eq 'ARRAY') {
+ $meta->$add_modifier_method( $_, $code ) for @{$args->[0]};
+ }
+ else {
+ $meta->throw_error(
+ sprintf(
+ "Methods passed to %s must be provided as a list, arrayref or regex, not %s",
+ $modifier_name,
+ $method_modifier_type,
+ )
+ );
+ }
}
else {
$meta->$add_modifier_method( $_, $code ) for @{$args};
The name resolution mechanism is covered in
L<Moose/Metaclass and Trait Name Resolution>.
-=item B<english_list(@items)>
-
-Given a list of scalars, turns them into a proper list in English
-("one and two", "one, two, three, and four"). This is used to help us
-make nicer error messages.
-
=item B<meta_class_alias($to[, $from])>
=item B<meta_attribute_alias($to[, $from])>
C<$from> is unspecified), so that
L<Moose/Metaclass and Trait Name Resolution> works properly.
+=item B<english_list(@items)>
+
+Given a list of scalars, turns them into a proper list in English
+("one and two", "one, two, three, and four"). This is used to help us
+make nicer error messages.
+
=back
=head1 TODO