line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Iugu::CRUD; |
2
|
|
|
|
|
|
|
$Net::Iugu::CRUD::VERSION = '0.000002'; |
3
|
8
|
|
|
8
|
|
2993
|
use Moo; |
|
8
|
|
|
|
|
13
|
|
|
8
|
|
|
|
|
30
|
|
4
|
|
|
|
|
|
|
extends 'Net::Iugu::Request'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub create { |
7
|
0
|
|
|
0
|
1
|
|
my ( $self, $data ) = @_; |
8
|
|
|
|
|
|
|
|
9
|
0
|
|
|
|
|
|
my $uri = $self->endpoint; |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
|
|
|
return $self->request( POST => $uri, $data ); |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub read { |
15
|
0
|
|
|
0
|
1
|
|
my ( $self, $object_id ) = @_; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my $uri = $self->endpoint . '/' . $object_id; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
return $self->request( GET => $uri ); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub update { |
23
|
0
|
|
|
0
|
1
|
|
my ( $self, $object_id, $data ) = @_; |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
my $uri = $self->endpoint . '/' . $object_id; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
return $self->request( PUT => $uri, $data ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub delete { |
31
|
0
|
|
|
0
|
1
|
|
my ( $self, $object_id ) = @_; |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
my $uri = $self->endpoint . '/' . $object_id; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
return $self->request( DELETE => $uri ); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub list { |
39
|
0
|
|
|
0
|
1
|
|
my ( $self, $params ) = @_; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
return $self->request( GET => $self->endpoint, $params ); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# ABSTRACT: Net::Iugu::CRUD - Methods for basic CRUD |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |