X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FActionContainer.pm;fp=lib%2FCatalyst%2FActionContainer.pm;h=ee7cfa7ed7aadb687cb7e401aef03b6329c724ec;hp=63b8fc9812e561efb443188b461ed17683a675ba;hb=059c085bfcead450e70ace9ef193aa99ac2ab37d;hpb=25f55123b7c0b520eb166890bf47f1f3217200af diff --git a/lib/Catalyst/ActionContainer.pm b/lib/Catalyst/ActionContainer.pm index 63b8fc9..ee7cfa7 100644 --- a/lib/Catalyst/ActionContainer.pm +++ b/lib/Catalyst/ActionContainer.pm @@ -1,8 +1,5 @@ package Catalyst::ActionContainer; -use strict; -use base qw/Class::Accessor::Fast/; - =head1 NAME Catalyst::ActionContainer - Catalyst Action Container @@ -18,24 +15,19 @@ to represent the various dispatch points in your application. =cut -__PACKAGE__->mk_accessors(qw/part actions/); - -use overload ( - - # Stringify to path part for tree search - q{""} => sub { shift->{part} }, +use Moose; -); - -sub new { - my ( $class, $fields ) = @_; - - $fields = { part => $fields, actions => {} } unless ref $fields; - - $class->SUPER::new($fields); -} +has part => (is => 'rw', required => 1, lazy => 1, default => sub { {} }); +has actions => (is => 'rw', required => 1, lazy => 1, default => sub { {} }); +around 'new' => sub { + my $next = shift; + my ($self, $params) = @_; + $params = { part => $params } unless ref $params; + $next->($self, $params); +}; +no Moose; sub get_action { my ( $self, $name ) = @_; @@ -78,6 +70,10 @@ Accessor to the actions hashref, containing all actions in this container. Accessor to the path part this container resolves to. Also what the container stringifies to. +=head2 meta + +Provided by Moose + =head1 AUTHOR Matt S. Trout