Make everything which used to inherit CAF use the MX::Emulate::CAF role + test
[catagits/Catalyst-Runtime.git] / lib / Catalyst / ActionContainer.pm
index bb1bbac..2e711d4 100644 (file)
@@ -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};