Make everything which used to inherit CAF use the MX::Emulate::CAF role + test
[catagits/Catalyst-Runtime.git] / lib / Catalyst / ActionContainer.pm
index 61fd0a9..2e711d4 100644 (file)
@@ -15,21 +15,23 @@ to represent the various dispatch points in your application.
 
 =cut
 
-use MRO::Compat;
-use mro 'c3';
 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 { {} });
 
-no Moose;
+around new => sub {
+  my ($orig, $self, $params) = @_;
+  $orig->($self, (ref($params) ? $params :  { part => $params } ));
+};
 
-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 ) = @_;
@@ -78,9 +80,9 @@ stringifies to.
 
 Provided by Moose
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-Matt S. Trout
+Catalyst Contributors, see Catalyst.pm
 
 =head1 COPYRIGHT