clean up logging and debug output, minor doc fixes
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Base.pm
index 7536dc6..b1990e9 100644 (file)
@@ -72,10 +72,15 @@ See L<Catalyst>
 
 Catalyst Base Class
 
+This is the base class for all Catalyst components. It also handles 
+dispatch of actions for controllers.
+
 =head1 METHODS
 
 =head2 $self->action_namespace($c)
 
+Determine the namespace for actions in this component.
+
 =cut
 
 sub action_namespace {
@@ -88,12 +93,16 @@ sub action_namespace {
 
 =head2 $self->path_prefix($c)
 
+alias for action_namespace
+
 =cut
 
 sub path_prefix { shift->action_namespace(@_); }
 
 =head2 $self->register_actions($c)
 
+register all actions for this component based on a given context.
+
 =cut
 
 sub register_actions {
@@ -127,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;