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=9d41f4e3947ee57b9748296c49304079cf028c2e;hp=ee7cfa7ed7aadb687cb7e401aef03b6329c724ec;hb=5fb12dbb7e69039e0ea22ec4d7cb627206b4508b;hpb=059c085bfcead450e70ace9ef193aa99ac2ab37d diff --git a/lib/Catalyst/ActionContainer.pm b/lib/Catalyst/ActionContainer.pm index ee7cfa7..9d41f4e 100644 --- a/lib/Catalyst/ActionContainer.pm +++ b/lib/Catalyst/ActionContainer.pm @@ -17,7 +17,14 @@ to represent the various dispatch points in your application. use Moose; -has part => (is => 'rw', required => 1, lazy => 1, default => sub { {} }); +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 { {} }); around 'new' => sub { @@ -41,6 +48,8 @@ sub add_action { $self->actions->{$name} = $action; } +__PACKAGE__->meta->make_immutable; + 1; __END__ @@ -76,7 +85,7 @@ Provided by Moose =head1 AUTHOR -Matt S. Trout +Matt S. Trout =head1 COPYRIGHT