X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FDispatcher.pm;h=0b262328205acbc430c1add2bf315fbd253d3499;hp=995cca55fe421e7263c54b1eaaf1d5c21a61f13e;hb=083ee5d9a198ffee958dd54179c7352e6dc13c11;hpb=fb9f65dbcb2cbb0b7b11bbad0b9449f47661b595 diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index 995cca5..0b26232 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -33,6 +33,14 @@ has postload_dispatch_types => (is => 'rw', required => 1, lazy => 1, default => has _action_hash => (is => 'rw', required => 1, lazy => 1, default => sub { {} }); has _container_hash => (is => 'rw', required => 1, lazy => 1, default => sub { {} }); +# Wrap accessors so you can assign a list and it will capture a list ref. +around qw/preload_dispatch_types postload_dispatch_types/ => sub { + my $orig = shift; + my $self = shift; + return $self->$orig([@_]) if (scalar @_ && ref $_[0] ne 'ARRAY'); + return $self->$orig(@_); +}; + no Moose; =head1 NAME