X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FDispatchType%2FChained.pm;fp=lib%2FCatalyst%2FDispatchType%2FChildOf.pm;h=132d9efb443f2465604b77a78b79e24106dd049d;hp=2ab537efc61816cedef89f451d2d3fab4a212027;hb=5882c86e1f256e122583dcc311b17bdbf9a4d766;hpb=9cc849968f79904d340abec75ebd6706746973b6 diff --git a/lib/Catalyst/DispatchType/ChildOf.pm b/lib/Catalyst/DispatchType/Chained.pm similarity index 93% rename from lib/Catalyst/DispatchType/ChildOf.pm rename to lib/Catalyst/DispatchType/Chained.pm index 2ab537e..132d9ef 100644 --- a/lib/Catalyst/DispatchType/ChildOf.pm +++ b/lib/Catalyst/DispatchType/Chained.pm @@ -1,4 +1,4 @@ -package Catalyst::DispatchType::ChildOf; +package Catalyst::DispatchType::Chained; use strict; use base qw/Catalyst::DispatchType/; @@ -10,7 +10,7 @@ use URI; =head1 NAME -Catalyst::DispatchType::ChildOf - Path Part DispatchType +Catalyst::DispatchType::Chained - Path Part DispatchType =head1 SYNOPSIS @@ -52,7 +52,7 @@ sub list { unshift(@parts, $pp->[0]) if (defined $pp->[0] && length $pp->[0]); } - $parent = $curr->attributes->{ChildOf}->[0]; + $parent = $curr->attributes->{Chained}->[0]; $curr = $self->{actions}{$parent}; unshift(@parents, $curr) if $curr; } @@ -163,13 +163,13 @@ Matt is an idiot and hasn't documented this yet. sub register { my ( $self, $c, $action ) = @_; - my @child_of_attr = @{ $action->attributes->{ChildOf} || [] }; + my @child_of_attr = @{ $action->attributes->{Chained} || [] }; return 0 unless @child_of_attr; if (@child_of_attr > 2) { Catalyst::Exception->throw( - "Multiple ChildOf attributes not supported registering ${action}" + "Multiple Chained attributes not supported registering ${action}" ); } @@ -183,7 +183,7 @@ sub register { $parent = '/'.$action->namespace; } - $action->attributes->{ChildOf} = [ $parent ]; + $action->attributes->{Chained} = [ $parent ]; my $children = ($self->{children_of}{$parent} ||= {}); @@ -221,7 +221,7 @@ Matt is an idiot and hasn't documented this yet. sub uri_for_action { my ( $self, $action, $captures ) = @_; - return undef unless ($action->attributes->{ChildOf} + return undef unless ($action->attributes->{Chained} && $action->attributes->{Args}); my @parts = (); @@ -237,7 +237,7 @@ sub uri_for_action { unshift(@parts, $pp->[0]) if (defined $pp->[0] && length $pp->[0]); } - $parent = $curr->attributes->{ChildOf}->[0]; + $parent = $curr->attributes->{Chained}->[0]; $curr = $self->{actions}{$parent}; }