[BACK]Return to md5.pm CVS log [TXT][DIR] Up to [local] / todotxt / Text-Todo-REST-API / lib / Text / Todo / REST / API / Representations

Annotation of todotxt/Text-Todo-REST-API/lib/Text/Todo/REST/API/Representations/md5.pm, Revision 1.6

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>