Sloth::Representation - An object capable of creating a representation of a resource
$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{.+/.+}).
$self->serialize($resource);
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.
Oliver Charles
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.
To install Sloth, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sloth
CPAN shell
perl -MCPAN -e shell install Sloth
For more information on module installation, please visit the detailed CPAN module installation guide.