File Coverage

blib/lib/WWW/Giraffi/API/Axion.pm
Criterion Covered Total %
statement 9 29 31.0
branch n/a
condition n/a
subroutine 3 13 23.0
pod 10 10 100.0
total 22 52 42.3


line stmt bran cond sub pod time code
1             package WWW::Giraffi::API::Axion;
2              
3 1     1   6 use strict;
  1         3  
  1         35  
4 1     1   5 use warnings;
  1         2  
  1         29  
5              
6 1     1   4 use parent qw(WWW::Giraffi::API::Request);
  1         2  
  1         9  
7              
8             our $VERSION = '0.2_04';
9              
10             sub all {
11              
12 0     0 1   my ( $self, $other_options ) = @_;
13 0           return $self->search(undef, $other_options);
14             }
15              
16             sub search {
17              
18 0     0 1   my ( $self, $conditions, $other_options ) = @_;
19 0           return $self->get( "axions.json", $conditions, $other_options );
20             }
21              
22             sub find {
23              
24 0     0 1   my ( $self, $id, $other_options ) = @_;
25 0           return $self->get( sprintf( "axions/%s.json", $id ), undef, $other_options );
26             }
27              
28             sub find_media {
29              
30 0     0 1   my ( $self, $id, $conditions, $other_options ) = @_;
31 0           return $self->get( sprintf( "axions/%s/media.json", $id ), $conditions, $other_options );
32             }
33              
34              
35             sub create {
36              
37 0     0 1   my ( $self, $conditions, $other_options ) = @_;
38 0           return $self->post( "axions.json", undef, { axion => $conditions }, $other_options );
39             }
40              
41             sub exec {
42              
43 0     0 1   my ( $self, $id, $other_options ) = @_;
44 0           return $self->post( sprintf("axions/%s/execute.json", $id), undef, undef, $other_options );
45             }
46              
47             sub update {
48              
49 0     0 1   my ( $self, $id, $conditions, $other_options ) = @_;
50 0           return $self->put( sprintf("axions/%s.json", $id), undef, { axion => $conditions }, $other_options );
51             }
52              
53             sub destroy {
54              
55 0     0 1   my ( $self, $id, $other_options ) = @_;
56 0           return $self->delete( sprintf("axions/%s.json", $id), undef, undef, $other_options );
57             }
58              
59             sub add_media {
60              
61 0     0 1   my ( $self, $id, $media_id, $other_options ) = @_;
62 0           return $self->put( sprintf("axions/%s/media/%s.json", $id, $media_id), undef, {}, $other_options );
63             }
64              
65             sub remove_media {
66              
67 0     0 1   my ( $self, $id, $media_id, $other_options ) = @_;
68 0           return $self->delete( sprintf("axions/%s/media/%s.json", $id, $media_id), undef, undef, $other_options );
69             }
70              
71             1;
72              
73             __END__