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