[Jifty-commit] r6511 - in jifty/trunk: lib/Jifty

Jifty commits jifty-commit at lists.jifty.org
Thu Feb 26 19:53:35 EST 2009


Author: sartak
Date: Thu Feb 26 19:53:35 2009
New Revision: 6511

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Web.pm

Log:
 r80672 at onn:  sartak | 2009-02-26 19:50:25 -0500
 Handle new_action('CreateFoo', moniker => 'create_foo') (makes "class" optional)


Modified: jifty/trunk/lib/Jifty/Web.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web.pm	(original)
+++ jifty/trunk/lib/Jifty/Web.pm	Thu Feb 26 19:53:35 2009
@@ -462,6 +462,8 @@
 Creates a new action (an instance of a subclass of
 L<Jifty::Action>). The named arguments passed to this method are
 passed on to the C<new> method of the action named in C<CLASS>.
+If you pass an odd number of arguments, then the first argument
+is interpreted as C<class>.
 
 =head3 Arguments
 
@@ -504,6 +506,9 @@
 sub new_action {
     my $self = shift;
 
+    # Handle new_action('CreateFoo', moniker => 'create_foo')
+    unshift @_, 'class' if @_ % 2;
+
     my %args = (
         class     => undef,
         moniker   => undef,


More information about the Jifty-commit mailing list