From: Shawn M Moore Date: Tue, 2 Dec 2008 08:46:53 +0000 (+0000) Subject: For now, forbid "alias" and "excludes" as keywords X-Git-Tag: 0.05~58 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=21c3ef8c081bfacc9553aeacee13f308280ee44f;p=gitmo%2FMooseX-Role-Parameterized.git For now, forbid "alias" and "excludes" as keywords --- diff --git a/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm b/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm index 6aa19de..6ccab6d 100644 --- a/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm +++ b/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm @@ -27,12 +27,27 @@ has role_generator => ( sub add_parameter { my $self = shift; - $self->parameter_metaclass->add_attribute(@_); + my $name = shift; + + # need to figure out a plan for these guys.. + confess "The parameter name ($name) is currently forbidden." + if $name eq 'alias' + || $name eq 'excludes'; + + $self->parameter_metaclass->add_attribute($name => @_); } sub construct_parameters { my $self = shift; - $self->parameter_metaclass->new_object(@_); + my %args = @_; + + # need to figure out a plan for these guys.. + for my $name ('alias', 'excludes') { + confess "The parameter name ($name) is currently forbidden." + if exists $args{$name}; + } + + $self->parameter_metaclass->new_object(\%args); } sub generate_role {