From: Yuval Kogman Date: Thu, 13 Apr 2006 14:41:24 +0000 (+0000) Subject: silly refactoring in Catalyst::Base X-Git-Tag: 5.7099_04~635 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=f40acefd4fe550234f968f2724cbfe028fca31cd silly refactoring in Catalyst::Base --- diff --git a/lib/Catalyst/Base.pm b/lib/Catalyst/Base.pm index 18e6f6e..b1990e9 100644 --- a/lib/Catalyst/Base.pm +++ b/lib/Catalyst/Base.pm @@ -136,20 +136,24 @@ sub register_actions { next; } my $reverse = $namespace ? "$namespace/$method" : $method; - my $action = $self->_action_class->new( - { - name => $method, - code => $code, - reverse => $reverse, - namespace => $namespace, - class => $class, - attributes => $attrs, - } + my $action = $self->create_action( + name => $method, + code => $code, + reverse => $reverse, + namespace => $namespace, + class => $class, + attributes => $attrs, ); + $c->dispatcher->register( $c, $action ); } } +sub create_action { + my $self = shift; + $self->_action_class->new( { @_ } ); +} + sub _parse_attrs { my ( $self, $c, $name, @attrs ) = @_; my %attributes;