Articulate

 view release on metacpan or  search on metacpan

lib/Articulate/Service/Simple.pm  view on Meta::CPAN

package Articulate::Service::Simple;

use strict;
use warnings;
use Articulate::Syntax;

use Moo;
with 'Articulate::Role::Service';

use Try::Tiny;
use Scalar::Util qw(blessed);

=head1 NAME

Articulate::Service::Simple - provide create, read, update, delete

=cut

=head1 METHODS

=head3 handle_create


  create => {
    meta     => {}
    content  => '...',
    location => '...'
  }

Creates new content. Throws an error if the content already exists or
if the user has no write permission on that location.

=head3 handle_read

  read => {
    location => '...'
  }

Retrieves the content at that location. Throws an error if the content
does not exist or if the user has no read permission on that location.

=head3 handle_update

  update => {
    meta     => {}
    content  => '...',
    location => '...'
  }

Updates the content at that location. Throws an error if the content
does not exist or if the user has no write permission on that location.

=head3 handle_delete

  delete => {
    location => '...'
  }

Deletes the content at that location. Throws an error if the content
does not exist or if the user has no write permission on that location.

=cut

sub handle_create {
  my $self    = shift;
  my $request = shift;
  my $item =
    blessed $request->data ? $request->data : $self->construction->construct(
    {
      meta => {},



( run in 2.103 seconds using v1.01-cache-2.11-cpan-f56aa216473 )