X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FActionContainer.pm;h=848f71aa21a63cb90167e74ee3879434cc9e8e5a;hb=b354201608d428db344c63dd35de096a62a7a9d3;hp=61fd0a990f6ce1b1884b2f852409f07483df2bff;hpb=6f1f968a6bc42bf4a4b50a1ee22d3aaecd801876;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/ActionContainer.pm b/lib/Catalyst/ActionContainer.pm index 61fd0a9..848f71a 100644 --- a/lib/Catalyst/ActionContainer.pm +++ b/lib/Catalyst/ActionContainer.pm @@ -15,21 +15,24 @@ 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 BUILDARGS => sub { + my ($next, $self, @args) = @_; + unshift @args, 'part' if scalar @args == 1 && !ref $args[0]; + return $self->$next(@args); +}; -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 +81,9 @@ stringifies to. Provided by Moose -=head1 AUTHOR +=head1 AUTHORS -Matt S. Trout +Catalyst Contributors, see Catalyst.pm =head1 COPYRIGHT