-
-
11 Mar 2011 11:34:57 UTC
- Distribution: Sloth
- Module version: 0.05
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (156 / 0 / 7)
- Kwalitee
Bus factor: 0- % Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (18.81KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- Oliver Charles
- Dependencies
- Data::TreeValidator
- HTTP::Request::Common
- HTTP::Status
- HTTP::Throwable
- Module::Pluggable
- Moose
- MooseX::NonMoose
- Path::Router
- Plack
- Plack::Test
- REST::Utils
- Scalar::Util
- String::CamelCase
- Test::Fatal
- Test::More
- Test::Routine
- Try::Tiny
- aliased
- namespace::autoclean
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Sloth::Representation - An object capable of creating a representation of a resource
METHODS
content_type
$self->content_type
Required. Classes which consume this role must implement this method.
Returns either a string of the content-type that this representation represents (ie, 'application/xml'), or a regular expression to match against a content type (ie, qr{.+/.+}).
serialize
$self->serialize($resource);
Required. Classes which consume this role must implement this method.
Takes a resource, returned by processing a Sloth::Method, and creates a representation of the resource. For example, a JSON representation might just return the result of "encode_json" in JSON::Any.
AUTHOR
Oliver Charles
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Oliver Charles <sloth.cpan@ocharles.org.uk>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Sloth, copy and paste the appropriate command in to your terminal.
cpanm Sloth
perl -MCPAN -e shell install Sloth
For more information on module installation, please visit the detailed CPAN module installation guide.