X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FActionContainer.pm;h=31e36cd072155a9d91c787f8515614e094edd242;hp=ee7cfa7ed7aadb687cb7e401aef03b6329c724ec;hb=f3414019f472b55682ef3af53f761b6db7955887;hpb=059c085bfcead450e70ace9ef193aa99ac2ab37d diff --git a/lib/Catalyst/ActionContainer.pm b/lib/Catalyst/ActionContainer.pm index ee7cfa7..31e36cd 100644 --- a/lib/Catalyst/ActionContainer.pm +++ b/lib/Catalyst/ActionContainer.pm @@ -15,19 +15,20 @@ to represent the various dispatch points in your application. =cut +use Class::C3; use Moose; -has part => (is => 'rw', required => 1, lazy => 1, default => sub { {} }); +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; +no Moose; + +sub new { my ($self, $params) = @_; $params = { part => $params } unless ref $params; - $next->($self, $params); -}; + $self->next::method($params); +} -no Moose; sub get_action { my ( $self, $name ) = @_; @@ -41,6 +42,8 @@ sub add_action { $self->actions->{$name} = $action; } +__PACKAGE__->meta->make_immutable; + 1; __END__ @@ -76,7 +79,7 @@ Provided by Moose =head1 AUTHOR -Matt S. Trout +Matt S. Trout =head1 COPYRIGHT