X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FActionContainer.pm;h=5be7292d2b9fae00c163d1110c46bde6184a9c2a;hb=88eee38e25dd1a991008fb5f61b848fcecb97ad0;hp=61fd0a990f6ce1b1884b2f852409f07483df2bff;hpb=6f1f968a6bc42bf4a4b50a1ee22d3aaecd801876;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/ActionContainer.pm b/lib/Catalyst/ActionContainer.pm index 61fd0a9..5be7292 100644 --- a/lib/Catalyst/ActionContainer.pm +++ b/lib/Catalyst/ActionContainer.pm @@ -15,21 +15,22 @@ to represent the various dispatch points in your application. =cut -use MRO::Compat; -use mro 'c3'; use Moose; -has part => (is => 'rw', required => 1, lazy => 1, default => sub { {} }); +has part => (is => 'rw', required => 1); has actions => (is => 'rw', required => 1, lazy => 1, default => sub { {} }); -no Moose; +around new => sub { + my ($orig, $self, $params) = @_; + $orig->($self, (ref($params) ? $params : { part => $params } )); +}; -sub new { - my ($self, $params) = @_; - $params = { part => $params } unless ref $params; - $self->next::method($params); -} +no Moose; +use overload ( + # Stringify to path part for tree search + q{""} => sub { shift->part }, +); sub get_action { my ( $self, $name ) = @_; @@ -78,9 +79,9 @@ stringifies to. Provided by Moose -=head1 AUTHOR +=head1 AUTHORS -Matt S. Trout +Catalyst Contributors, see Catalyst.pm =head1 COPYRIGHT