Paul Jamieson Fenwick > WebService-HabitRPG-0.17 > WebService::HabitRPG::Task

Download:
WebService-HabitRPG-0.17.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Module Version: 0.17   Source   Latest Release: WebService-HabitRPG-0.21

NAME ^

WebService::HabitRPG::Task - A HabitRPG task

VERSION ^

version 0.17

SYNOPSIS ^

    my $task = WebService::HabitRRG::Task->new(
        text  => 'Floss teeth',
        id    => 'a670fc50-4e04-4b0f-9583-e4ee55fced02',
        up    => 1,
        down  => 0,
        value => 0,
        type  => 'habit',
    );

    say "Task name: ", $task->text;

DESCRIPTION ^

Represents a HabitRPG task object. All properties shown in the synopsis are checked for sanity and are available as methods.

The history, completed and repeat attributes may also be provided at build-time, but are optional. No checking is done on them (yet).

METHODS ^

active_today()

    if ( $task->active_today ) { # This task is active today! }

Returns a true value if this task is due today. To check if it's already completed, check $task-completed >.

format_task()

    say $task->format_task;

Generated a formatted form of the task, including check-boxes for todo and daily tasks, and + and - signs for habits.

AUTHOR ^

Paul Fenwick <pjf@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2013 by Paul Fenwick.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: