X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FActionContainer.pm;h=2e711d4d500a451ddc469b497140283def1c9e71;hb=531f1ab6f98c126f57075dbbca4884ac9728703c;hp=9d41f4e3947ee57b9748296c49304079cf028c2e;hpb=5fb12dbb7e69039e0ea22ec4d7cb627206b4508b;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/ActionContainer.pm b/lib/Catalyst/ActionContainer.pm index 9d41f4e..2e711d4 100644 --- a/lib/Catalyst/ActionContainer.pm +++ b/lib/Catalyst/ActionContainer.pm @@ -16,26 +16,23 @@ to represent the various dispatch points in your application. =cut 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 { {} }); -around 'new' => sub { - my $next = shift; - my ($self, $params) = @_; - $params = { part => $params } unless ref $params; - $next->($self, $params); +around new => sub { + my ($orig, $self, $params) = @_; + $orig->($self, (ref($params) ? $params : { part => $params } )); }; no Moose; +use overload ( + # Stringify to path part for tree search + q{""} => sub { shift->part }, +); + sub get_action { my ( $self, $name ) = @_; return $self->actions->{$name} if defined $self->actions->{$name}; @@ -83,9 +80,9 @@ stringifies to. Provided by Moose -=head1 AUTHOR +=head1 AUTHORS -Matt S. Trout +Catalyst Contributors, see Catalyst.pm =head1 COPYRIGHT