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

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Wed Jun 28 12:05:43 EDT 2006


Author: nelhage
Date: Wed Jun 28 12:05:42 2006
New Revision: 1374

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

Log:
 r13207 at phanatique:  nelhage | 2006-06-25 15:10:20 +0200
 Adding a has_argument sub so that users don't have to check exists ->argument_values->{foo}. Abstractions++


Modified: jifty/trunk/lib/Jifty/Action.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Action.pm	(original)
+++ jifty/trunk/lib/Jifty/Action.pm	Wed Jun 28 12:05:42 2006
@@ -282,6 +282,22 @@
 }
 
 
+=head2 has_argument ARGUMENT
+
+Returns true if the action has been provided with an value for the
+given argument, including a default_value, and false if none was ever
+passed in.
+
+=cut
+
+sub has_argument {
+    my $self = shift;
+    my $arg = shift;
+
+    return exists $self->argument_values->{$arg};
+}
+
+
 =head2 form_field ARGUMENT
 
 Returns a L<Jifty::Web::Form::Field> object for this argument.  If


More information about the Jifty-commit mailing list