- SEE ALSO
- COPYRIGHT & LICENSE
App::Toodledo::Task - class encapsulating a Toodledo task
$task = App::Toodledo::Task->new; $task->title( 'Put the cat out' );
This class provides accessors for the properties of a Toodledo task. The attributes of a task are defined in the App::Toodledo::TaskRole module.
Return the tags of the task as a list (splits the attribute on comma). If a list is provided, set the tags to that list.
Return true if the tag
$tag is in the list returned by
Add the given tag. No-op if the task already has that tag.
Remove the given tag. No-op if the task doesn't have that tag.
This is the method called by:
App::Toodledo::edit( $task )
You can pass multiple tasks to it:
$todo->edit( @tasks )
and they will all be updated. The current maximum number of tasks you can send to Toodledo for editing is 50. This method does not check for that. (They might raise the limit in the future.) Bounds checking is the caller's responsibility.
Each of these methods operates on the string defined at http://api.toodledo.com/2/tasks/index.php, not the integer. The string will be turned into the integer going into Toodledo and the integer will get turned into the string coming out. Examples:
$task->priority_str( 'Top' ) $task->status_str eq 'Hold' and ...
Each method can be used in a App::Toodledo::select call.
Each of these methods returns and optionally sets the given attribute via its name rather than the indirect ID that is stored in the task. An exception is thrown if no object with that name exists when setting it. Examples:
$task->folder_name( $todo, 'Later' ); $task->context_name( $todo ) eq 'Home' and ...
If the value is null, returns the empty string rather than the Toodledo display value of "No <Whatever>".
NOTE: An App::Toodledo object must be passed as the first parameter so it can look up the mapping of objects to names.
This is a very basic implementation of Toodledo tasks. It is missing much that would be helpful with dealing with repeating tasks. Patches welcome.
Peter J. Scott,
<cpan at psdt.com>
Toodledo API documentation: http://www.toodledo.com/info/api_doc.php.
Copyright 2009-2011 Peter J. Scott, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.