X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FActionContainer.pm;h=f3cb7e06669bc8f79130bb50fa31d3b25b344e7c;hp=a51f90a0e2d9f14e04b24bf6e4b7cfce94d446e6;hb=4090e3bb3fea1a73ac369250e31584d61428b808;hpb=0fc2d522eec43202c21e9f0062e43f10db4d9008 diff --git a/lib/Catalyst/ActionContainer.pm b/lib/Catalyst/ActionContainer.pm index a51f90a..f3cb7e0 100644 --- a/lib/Catalyst/ActionContainer.pm +++ b/lib/Catalyst/ActionContainer.pm @@ -15,27 +15,17 @@ to represent the various dispatch points in your application. =cut -use Class::C3; use Moose; -use overload ( - - # Stringify to path part for tree search - q{""} => sub { shift->part }, - -); - has part => (is => 'rw', required => 1, lazy => 1, default => sub { {} }); has actions => (is => 'rw', required => 1, lazy => 1, default => sub { {} }); -no Moose; - -sub new { - my ($self, $params) = @_; - $params = { part => $params } unless ref $params; - $self->next::method($params); -} +around new => sub { + my ($orig, $self, $params) = @_; + $orig->($self, (ref($params) ? $params : { part => $params } )); +}; +no Moose; sub get_action { my ( $self, $name ) = @_;