Annotation of todotxt/Text-Todo-REST-API/lib/Text/Todo/REST/API/Representations/text.pm, Revision 1.2
1.1 andrew 1: package Text::Todo::REST::API::Representations::text;
2:
1.2 ! andrew 3: # $AFresh1: text.pm,v 1.1 2010/01/18 03:51:40 andrew Exp $
1.1 andrew 4:
1.2 ! andrew 5: use base 'Text::Todo::REST::API::Representations';
1.1 andrew 6:
7: use warnings;
8: use strict;
9: use Carp;
10:
11: use version; our $VERSION = qv('0.0.1');
12:
13: {
1.2 ! andrew 14: sub content_type { return 'text/plain' }
1.1 andrew 15:
1.2 ! andrew 16: sub can_format {
! 17: my ( $class, $format ) = @_;
! 18: return if !defined $format;
! 19:
! 20: my %handled_formats = map { $_ => 1 } qw(
! 21: text
! 22: txt
! 23: );
1.1 andrew 24:
25: return exists $handled_formats{$format};
26: }
27:
1.2 ! andrew 28: sub dump_files {
! 29: my ( $self, $format, @input ) = @_;
1.1 andrew 30:
1.2 ! andrew 31: my $output;
! 32: foreach my $line (@input) {
! 33: $output .= "$line\n";
! 34: }
! 35: return $output;
! 36: }
! 37:
! 38: sub dump_list {
! 39: my ( $self, $format, @input ) = @_;
1.1 andrew 40:
41: my $output;
1.2 ! andrew 42: foreach my $o (@input) {
! 43: $output .= "$o->{text}\n";
1.1 andrew 44: }
45: return $output;
46: }
1.2 ! andrew 47:
! 48: sub dump_entry {
! 49: my ( $self, @args ) = @_;
! 50: return $self->dump_list(@args);
! 51: }
1.1 andrew 52: }
53:
1.2 ! andrew 54: 1; # Magic true value required at end of module
1.1 andrew 55: __END__
56:
57: =head1 NAME
58:
59: Text::Todo::REST::API::text - [One line description of module's purpose here]
60:
61:
62: =head1 VERSION
63:
64: This document describes Text::Todo::REST::API::text version 0.0.1
65:
66:
67: =head1 SYNOPSIS
68:
69: use Text::Todo::REST::API::text;
70:
71: =for author to fill in:
72: Brief code example(s) here showing commonest usage(s).
73: This section will be as far as many users bother reading
74: so make it as educational and exeplary as possible.
75:
76:
77: =head1 DESCRIPTION
78:
79: =for author to fill in:
80: Write a full description of the module and its features here.
81: Use subsections (=head2, =head3) as appropriate.
82:
83:
84: =head1 INTERFACE
85:
86: =for author to fill in:
87: Write a separate section listing the public components of the modules
88: interface. These normally consist of either subroutines that may be
89: exported, or methods that may be called on objects belonging to the
90: classes provided by the module.
91:
92:
93: =head1 DIAGNOSTICS
94:
95: =for author to fill in:
96: List every single error and warning message that the module can
97: generate (even the ones that will "never happen"), with a full
98: explanation of each problem, one or more likely causes, and any
99: suggested remedies.
100:
101: =over
102:
103: =item C<< Error message here, perhaps with %s placeholders >>
104:
105: [Description of error here]
106:
107: =item C<< Another error message here >>
108:
109: [Description of error here]
110:
111: [Et cetera, et cetera]
112:
113: =back
114:
115:
116: =head1 CONFIGURATION AND ENVIRONMENT
117:
118: =for author to fill in:
119: A full explanation of any configuration system(s) used by the
120: module, including the names and locations of any configuration
121: files, and the meaning of any environment variables or properties
122: that can be set. These descriptions must also include details of any
123: configuration language used.
124:
125: Text::Todo::REST::API::text requires no configuration files or environment variables.
126:
127:
128: =head1 DEPENDENCIES
129:
130: =for author to fill in:
131: A list of all the other modules that this module relies upon,
132: including any restrictions on versions, and an indication whether
133: the module is part of the standard Perl distribution, part of the
134: module's distribution, or must be installed separately. ]
135:
136: None.
137:
138:
139: =head1 INCOMPATIBILITIES
140:
141: =for author to fill in:
142: A list of any modules that this module cannot be used in conjunction
143: with. This may be due to name conflicts in the interface, or
144: competition for system or program resources, or due to internal
145: limitations of Perl (for example, many modules that use source code
146: filters are mutually incompatible).
147:
148: None reported.
149:
150:
151: =head1 BUGS AND LIMITATIONS
152:
153: =for author to fill in:
154: A list of known problems with the module, together with some
155: indication Whether they are likely to be fixed in an upcoming
156: release. Also a list of restrictions on the features the module
157: does provide: data types that cannot be handled, performance issues
158: and the circumstances in which they may arise, practical
159: limitations on the size of data sets, special cases that are not
160: (yet) handled, etc.
161:
162: No bugs have been reported.
163:
164: Please report any bugs or feature requests to
165: C<bug-text-todo-rest-api-text@rt.cpan.org>, or through the web interface at
166: L<http://rt.cpan.org>.
167:
168:
169: =head1 AUTHOR
170:
171: Andrew Fresh C<< <andrew@cpan.org> >>
172:
173:
174: =head1 LICENSE AND COPYRIGHT
175:
176: Copyright (c) 2010, Andrew Fresh C<< <andrew@cpan.org> >>. All rights reserved.
177:
178: This module is free software; you can redistribute it and/or
179: modify it under the same terms as Perl itself. See L<perlartistic>.
180:
181:
182: =head1 DISCLAIMER OF WARRANTY
183:
184: BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
185: FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
186: OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
187: PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
188: EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
189: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
190: ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
191: YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
192: NECESSARY SERVICING, REPAIR, OR CORRECTION.
193:
194: IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
195: WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
196: REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
197: LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
198: OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
199: THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
200: RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
201: FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
202: SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
203: SUCH DAMAGES.
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>