add chained to the list of successful conversions :)
[catagits/Catalyst-Runtime.git] / lib / Catalyst / DispatchType / Chained.pm
index bc12721..257f7fb 100644 (file)
@@ -1,28 +1,30 @@
 package Catalyst::DispatchType::Chained;
 
 use Moose;
+extends 'Catalyst::DispatchType';
+
+#use strict;
+#use base qw/Catalyst::DispatchType/;
 use Text::SimpleTable;
 use Catalyst::ActionChain;
 use URI;
 
-extends 'Catalyst::DispatchType';
-
 has _endpoints => (
-                   isa => 'rw',
+                   is => 'rw',
                    isa => 'ArrayRef',
                    required => 1,
                    default => sub{ [] },
                   );
 
 has _actions => (
-                 isa => 'rw',
+                 is => 'rw',
                  isa => 'HashRef',
                  required => 1,
                  default => sub{ {} },
                 );
 
 has _children_of => (
-                     isa => 'rw',
+                     is => 'rw',
                      isa => 'HashRef',
                      required => 1,
                      default => sub{ {} },
@@ -254,7 +256,7 @@ sub register {
 
     $action->attributes->{Chained} = [ $parent ];
 
-    my $children = $self->_children_of->{$parent};
+    my $children = ($self->_children_of->{$parent} ||= {});
 
     my @path_part = @{ $action->attributes->{PathPart} || [] };