App-Toodledo

 view release on metacpan or  search on metacpan

lib/App/Toodledo.pm  view on Meta::CPAN

can be added.
Note: this method is overridden in App::Toodledo::Task.

=head2 $todo->delete( $object )

Delete the given object from Toodledo. The C<id> attribute of the object
must be correctly set. No other attributes will be used.
Note: this method is overridden in App::Toodledo::Task.

=head2 $todo->edit( $object )

The given object will be updated in Toodledo to match the one passed.
Note: this method is overridden in App::Toodledo::Task.  When the object
is a task, the signature is:

=head2 $todo->edit( $task, [@tasks] )

All of the tasks will be edited.  You are responsible for ensuring
that you do not exceed Toodledo limits on the number of tasks passed
(currently 50).

=head2 @objects = $todo->select( \@objects, $expr );

Select just the objects you need from the given array, based upon the
expression.  Any attribute of the given objects specified in the exprssion
will br turned into an object accessor for that attribute and the resulting
expression must be syntactically correct.  Any Perl code can be used; it will
be passed through C<eval>.  Examples:

=over 4

=item tag eq "garden" && status > 3

Must have the 'garden' tag (and only that tag) amd a status greater
than the index for the status value 'Planning'.  (Only makes sense for
a task list.)  To access (or change) the status as a string,
use C<status_str>.

=item title =~ /deliver/i && comp == 1

Title must match regex and task must be completed.

=back

The type of object is determined from the first one in the arrayref.

=head2 @objects = $todo->grep_objects( \@objects, $coderef )

Run $coderef for each object in the list.  Called by the
C<select> method but can be used by the user.  Ones for which
the C<$coderef> returns true will be passed through to the result.

=head2 $todo->foreach( \@objects, $coderef, [@args] )

Run the coderef on each object in the arrayref.  C<$coderef>
will be called with the object as the first argument and
any C<@args> as the rest.

=head2 $todo->readable( $object, $attribute )

Currently just looks to see if the given C<$attribute> of C<$object>
is a date and if so, returns the C<preferred_date_formst> string
from L<App::Toodledo::Util> instead of the stored epoch second count.
If the date is null, returns an empty string (rather than the Toodledo
display of "no date").

=head1 ERRORS

Any API call may croak if it returns an error.

=head1 FILES

=head2 ~/.toodledo_token

This file is in YAML format and caches the session token for one or
more application ids.  You should not need to edit it.

=head2 ~/.toodledorc

This file is in YAML format and is where you keep information to save
having to enter it in login calls.  It is not written by App::Toodledo.
It is of the following format:

  ---
  app_tokens:
    <app_id>: <app_token>
  default_user_id: <user_id>
  passwords:
    <user_id>: <password>

The app_id line may be repeated for as many application ids that you have.
It supplies the application token corresponding to each app_id.  Since
the app_id is a mnemonic string like 'cpantest' and the app_token is
a hex identifier supplied by Toodledo like 'api4e49ce90e5c31', this saves
the trouble of copying arcane strings into every program.
The password line may be repeated for as many user ids that you want
to manage.
The default_user_id is optional and will be used if none is specified
in a login call.

=head2 ~/.toodledo_task_cache

This file is in YAML format and is used by App::Toodledo to store a
cache of tasks.  You should not need to edit it.  If App::Toodledo is
using this cache and you believe it to be invalid, delete this file.

=head1 ENVIRONMENT

App::Toodledo uses log4perl for error logging and debug messages.  By
default they will be outputted to STDOUT, and STDERR.  A log4perl can
be specified in the users application, if one is not set App::Toodledo
will use Log::Log4perl::easy_init($ERROR); Setting the environment
variable C<APP_TOODLEDO_DEBUG> will cause debugging-type information
to be output to log4perl logger.  If a logger hasn't been set
App::Toodledo will use Log::Log4perl::easy_init($DEBUG);


=head1 AUTHOR

Peter J. Scott, C<< <cpan at psdt.com> >>



( run in 1.895 second using v1.01-cache-2.11-cpan-5735350b133 )