X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FRole%2FApplication.pm;h=8c45eb6aa7e1108e630114ed27f4c8388f555121;hb=8de5717850eb1f406e5f71d2ccfac33c72cc490b;hp=636dff7057da1b361718ef6e54b50791e4ecb4a4;hpb=6fdf3dfaab2a36f6a73204759df23782f0b1940f;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Role/Application.pm b/lib/Moose/Meta/Role/Application.pm index 636dff7..8c45eb6 100644 --- a/lib/Moose/Meta/Role/Application.pm +++ b/lib/Moose/Meta/Role/Application.pm @@ -4,18 +4,18 @@ use strict; use warnings; use metaclass; -our $VERSION = '0.88'; +our $VERSION = '0.92'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; __PACKAGE__->meta->add_attribute('method_exclusions' => ( - init_arg => 'excludes', + init_arg => '-excludes', reader => 'get_method_exclusions', default => sub { [] } )); __PACKAGE__->meta->add_attribute('method_aliases' => ( - init_arg => 'alias', + init_arg => '-alias', reader => 'get_method_aliases', default => sub { {} } )); @@ -23,11 +23,21 @@ __PACKAGE__->meta->add_attribute('method_aliases' => ( sub new { my ($class, %params) = @_; - if (exists $params{excludes}) { + if ( exists $params{excludes} && !exists $params{'-excludes'} ) { + $params{'-excludes'} = delete $params{excludes}; + } + if ( exists $params{alias} && !exists $params{'-alias'} ) { + $params{'-alias'} = delete $params{alias}; + } + + if ( exists $params{'-excludes'} ) { + # I wish we had coercion here :) - $params{excludes} = (ref $params{excludes} eq 'ARRAY' - ? $params{excludes} - : [ $params{excludes} ]); + $params{'-excludes'} = ( + ref $params{'-excludes'} eq 'ARRAY' + ? $params{'-excludes'} + : [ $params{'-excludes'} ] + ); } $class->_new(\%params);