blib/lib/CatalystX/Resource/TraitFor/Controller/Resource/Delete.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 19 CC 1 SCAR 6.9
CC
1
Cov
0%
delete
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package CatalystX::Resource::TraitFor::Controller::Resource::Delete;
2 $CatalystX::Resource::TraitFor::Controller::Resource::Delete::VERSION = '0.009_002';
3 use MooseX::MethodAttributes::Role;
4 use namespace::autoclean;
5  
6 # ABSTRACT: a delete action for your resource
7  
8 requires qw/
9 resource_key
10 _msg
11 _redirect
12 /;
13  
14  
15 sub delete : Method('POST') Chained('base_with_id') PathPart('delete') Args(0) {
16 my ( $self, $c ) = @_;
17 my $resource = $c->stash->{ $self->resource_key };
18 my $msg = $self->_msg( $c, 'delete' );
19 $resource->delete;
20 $c->flash( msg => $msg );
21 $self->_redirect($c);
22 }
23  
24 1;
25  
26 __END__
27  
28 =pod
29  
30 =encoding UTF-8
31  
32 =head1 NAME
33  
34 CatalystX::Resource::TraitFor::Controller::Resource::Delete - a delete action for your resource
35  
36 =head1 VERSION
37  
38 version 0.009_002
39  
40 =head1 ACTIONS
41  
42 =head2 delete
43  
44 delete a specific resource with a POST request
45  
46 =head1 AUTHOR
47  
48 David Schmidt <davewood@cpan.org>
49  
50 =head1 COPYRIGHT AND LICENSE
51  
52 This software is copyright (c) 2011 by David Schmidt.
53  
54 This is free software; you can redistribute it and/or modify it under
55 the same terms as the Perl 5 programming language system itself.
56  
57 =cut