[Bps-public-commit] r11922 - in Net-Hiveminder: lib/Net

sartak at bestpractical.com sartak at bestpractical.com
Mon Apr 28 16:04:42 EDT 2008


Author: sartak
Date: Mon Apr 28 16:04:38 2008
New Revision: 11922

Modified:
   Net-Hiveminder/   (props changed)
   Net-Hiveminder/lib/Net/Hiveminder.pm

Log:
 r54527 at onn:  sartak | 2008-04-28 16:04:27 -0400
 If the user passes only one argument to get_tasks or todo_tasks, assume they mean "use this string as tokens"


Modified: Net-Hiveminder/lib/Net/Hiveminder.pm
==============================================================================
--- Net-Hiveminder/lib/Net/Hiveminder.pm	(original)
+++ Net-Hiveminder/lib/Net/Hiveminder.pm	Mon Apr 28 16:04:38 2008
@@ -165,7 +165,10 @@
 
 sub get_tasks {
     my $self = shift;
-    return @{ $self->act('TaskSearch', @_)->{content}{tasks} };
+    my @args = @_;
+    unshift @args, "tokens" if @args == 1;
+
+    return @{ $self->act('TaskSearch', @args)->{content}{tasks} };
 }
 
 =head2 todo_tasks [ARGS]
@@ -178,6 +181,8 @@
 
 sub todo_tasks {
     my $self = shift;
+    my @args = @_;
+    unshift @args, "tokens" if @args == 1;
 
     $self->get_tasks(
         complete_not     => 1,
@@ -190,7 +195,7 @@
 
         # XXX: this is one place to improve the API
 
-        @_
+        @args
     );
 }
 



More information about the Bps-public-commit mailing list