X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FActionContainer.pm;h=2e711d4d500a451ddc469b497140283def1c9e71;hb=8be895a7aa1d89a8004cc0cd37962025bc5c3b3d;hp=f3cb7e06669bc8f79130bb50fa31d3b25b344e7c;hpb=4090e3bb3fea1a73ac369250e31584d61428b808;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/ActionContainer.pm b/lib/Catalyst/ActionContainer.pm index f3cb7e0..2e711d4 100644 --- a/lib/Catalyst/ActionContainer.pm +++ b/lib/Catalyst/ActionContainer.pm @@ -16,8 +16,9 @@ to represent the various dispatch points in your application. =cut use Moose; +with 'MooseX::Emulate::Class::Accessor::Fast'; -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 { @@ -27,6 +28,11 @@ around new => sub { 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}; @@ -74,9 +80,9 @@ stringifies to. Provided by Moose -=head1 AUTHOR +=head1 AUTHORS -Matt S. Trout +Catalyst Contributors, see Catalyst.pm =head1 COPYRIGHT