version 1.1, 2010/01/16 16:01:07 |
version 1.2, 2010/01/17 23:15:00 |
|
|
package Text::Todo::REST::API::text; |
package Text::Todo::REST::API::text; |
|
|
# $RedRiver$ |
# $AFresh1$ |
|
|
|
use base 'Text::Todo::REST::API'; |
|
&Text::Todo::REST::API::RegisterFormatHandler(__PACKAGE__, 'text', 'txt'); |
|
|
use warnings; |
use warnings; |
use strict; |
use strict; |
use Carp; |
use Carp; |
|
|
|
use File::Spec; |
|
|
use version; our $VERSION = qv('0.0.1'); |
use version; our $VERSION = qv('0.0.1'); |
|
|
# Other recommended modules (uncomment to use): |
{ |
# use IO::Prompt; |
sub Dump { |
# use Perl6::Export; |
my ($self, @output) = @_; |
# use Perl6::Slurp; |
my $action = $self->_action; |
# use Perl6::Say; |
|
|
|
|
my $output; |
# Module implementation here |
if ($action eq 'files') { |
|
foreach my $o (@output) { |
|
$output .= "$o\n"; |
|
} |
|
} |
|
elsif ($action eq 'list' || $action eq 'entry') { |
|
foreach my $o (@output) { |
|
$output .= "$o->{text}\n"; |
|
} |
|
} |
|
else { |
|
$output .= $self->SUPER::Dump(@output); |
|
} |
|
return $output; |
|
} |
|
} |
|
|
1; # Magic true value required at end of module |
1; # Magic true value required at end of module |
__END__ |
__END__ |