03 Mar 2011 14:09:54 UTC
- Distribution: Sloth
- Module version: 0.03
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (44 / 0 / 0)
- KwaliteeBus factor: 0
- License: perl_5
- Activity24 month
- Download (17.59KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionCYCLES Oliver Charlesand 1 contributors
- Oliver Charles
- COPYRIGHT AND LICENSE
Sloth::Resource - A resource that exposed by the REST server
ArrayRef[Sloth::Representation]of all known representations of resources.
By default, this will be taken from Sloth, your main Sloth application. However, if this resource only has specific representations that differ from the rest of you application, you can override it.
A map of allowed HTTP methods on this resource, to their Sloth::Method implementation. By default you do not need to worry about specifying this attribute as Sloth will default to looking for methods below the current resource namespace (for example,
Resource::Pancakewould look for
Resource::Pancake::GETand so on).
$self->resource_arguments : @List
Generate a set of parameters that will be passed to methods. If your methods all require a set of common, shared objects, you can override this to provide those extra initialization arguments.
$self->handle_request($request : Sloth::Request)
Handle a request for a resource.
You will not normally need to change this method, as by default it will check if the method is allowed, if there is an available serializer, and handle all the dispatching for you.
This software is copyright (c) 2011 by Oliver Charles <firstname.lastname@example.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.