WebAPI::DBIC::Resource::ActiveModel
version 0.004001
WebAPI::DBIC::Resource::ActiveModel - ActiveModel support for WebAPI::DBIC
These roles respond to the application/json media type. (This is a very common 'default' media type for web data services.)
application/json
Designed to match the behaviour of the active_model_serializers Ruby gem and thus be directly usable as a backend for frameworks compatible with it, including Ember.
See http://emberjs.com/api/data/classes/DS.ActiveModelAdapter.html for more information.
The WebAPI::DBIC::Resource::ActiveModel::Role::DBIC role provides core methods required to support the other roles listed below.
The WebAPI::DBIC::Resource::ActiveModel::Role::Set and WebAPI::DBIC::Resource::ActiveModel::Role::Item roles handle GET and HEAD requests for set (resultset) and item (row) resources.
The WebAPI::DBIC::Resource::ActiveModel::Role::SetWritable role handles POST requests to set (resultset) resources. It handles the recursive creation of related records. Related records can be nested to any depth and are created from the bottom up within a transaction.
The WebAPI::DBIC::Resource::ActiveModel::Role::ItemWritable roles handle PUT and DELETE requests for item (row) resources. It handles the recursive update of related records. Related records can be nested to any depth and are updated from the bottom up within a transaction. Handles both 'PUT is replace' and 'PUT is update' logic.
There's no ActiveModel specific handling for invoking methods on resources yet. You can use the generic WebAPI::DBIC::Resource::Role::ItemInvoke or WebAPI::DBIC::Resource::Role::SetInvoke role.
Tim Bunce <Tim.Bunce@pobox.com>
This software is copyright (c) 2015 by Tim Bunce.
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 WebAPI::DBIC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebAPI::DBIC
CPAN shell
perl -MCPAN -e shell install WebAPI::DBIC
For more information on module installation, please visit the detailed CPAN module installation guide.