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=e8f71fe3dcdfd053130cf642165c7fefbe4b95ce;hp=a51f90a0e2d9f14e04b24bf6e4b7cfce94d446e6;hb=807303a1658f895c41417beba24d24ff9b71c194;hpb=0fc2d522eec43202c21e9f0062e43f10db4d9008 diff --git a/lib/Catalyst/ActionContainer.pm b/lib/Catalyst/ActionContainer.pm index a51f90a..e8f71fe 100644 --- a/lib/Catalyst/ActionContainer.pm +++ b/lib/Catalyst/ActionContainer.pm @@ -15,27 +15,24 @@ to represent the various dispatch points in your application. =cut -use Class::C3; use Moose; +with 'MooseX::Emulate::Class::Accessor::Fast'; -use overload ( - - # Stringify to path part for tree search - q{""} => sub { shift->part }, - -); - -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 BUILDARGS => sub { + my ($next, $self, @args) = @_; + unshift @args, 'part' if scalar @args == 1 && !ref $args[0]; + return $self->$next(@args); +}; -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 ) = @_; @@ -84,13 +81,13 @@ stringifies to. Provided by Moose -=head1 AUTHOR +=head1 AUTHORS -Matt S. Trout +Catalyst Contributors, see Catalyst.pm =head1 COPYRIGHT -This program is free software, you can redistribute it and/or modify it under +This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself. =cut