ActionChains part attribute doesn't need a default.
[catagits/Catalyst-Runtime.git] / lib / Catalyst / ActionContainer.pm
index ee7cfa7..2f98be1 100644 (file)
@@ -17,14 +17,12 @@ to represent the various dispatch points in your application.
 
 use Moose;
 
-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 { {} });
 
-around 'new' => sub {
-  my $next = shift;
-  my ($self, $params) = @_;
-  $params = { part => $params } unless ref $params;
-  $next->($self, $params);
+around new => sub {
+  my ($orig, $self, $params) = @_;
+  $orig->($self, (ref($params) ? $params :  { part => $params } ));
 };
 
 no Moose;
@@ -41,6 +39,8 @@ sub add_action {
     $self->actions->{$name} = $action;
 }
 
+__PACKAGE__->meta->make_immutable;
+
 1;
 
 __END__
@@ -74,9 +74,9 @@ stringifies to.
 
 Provided by Moose
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-Matt S. Trout 
+Catalyst Contributors, see Catalyst.pm
 
 =head1 COPYRIGHT