[Catalyst-commits] r9299 - Catalyst-Runtime/5.80/trunk/lib/Catalyst

rafl at dev.catalyst.perl.org rafl at dev.catalyst.perl.org
Sat Feb 14 05:57:23 GMT 2009


Author: rafl
Date: 2009-02-14 05:57:23 +0000 (Sat, 14 Feb 2009)
New Revision: 9299

Modified:
   Catalyst-Runtime/5.80/trunk/lib/Catalyst/ActionContainer.pm
Log:
Make ActionContainer use BUILDARGS instead of wrapping the constructor.

Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/ActionContainer.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/ActionContainer.pm	2009-02-13 16:51:25 UTC (rev 9298)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/ActionContainer.pm	2009-02-14 05:57:23 UTC (rev 9299)
@@ -21,9 +21,10 @@
 has part => (is => 'rw', required => 1);
 has actions => (is => 'rw', required => 1, lazy => 1, default => sub { {} });
 
-around new => sub {
-  my ($orig, $self, $params) = @_;
-  $orig->($self, (ref($params) ? $params :  { part => $params } ));
+around BUILDARGS => sub {
+    my ($next, $self, @args) = @_;
+    unshift @args, 'part' if scalar @args == 1 && !ref $args[0];
+    return $self->$next(@args);
 };
 
 no Moose;




More information about the Catalyst-commits mailing list