projects
/
gitmo/MooseX-Role-Parameterized.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
Let the parameter keyword take an arrayref of names
[gitmo/MooseX-Role-Parameterized.git]
/
lib
/
MooseX
/
Role
/
Parameterized.pm
diff --git
a/lib/MooseX/Role/Parameterized.pm
b/lib/MooseX/Role/Parameterized.pm
index
f1fc28e
..
3f23a53
100644
(file)
--- a/
lib/MooseX/Role/Parameterized.pm
+++ b/
lib/MooseX/Role/Parameterized.pm
@@
-14,7
+14,13
@@
__PACKAGE__->setup_import_methods(
sub parameter {
my $caller = shift;
- $caller->meta->add_parameter(@_);
+ my $names = shift;
+
+ $names = [$names] if !ref($names);
+
+ for my $name (@$names) {
+ $caller->meta->add_parameter($name, @_);
+ }
}
sub role {