Newsletter/Lists.pm

filter: Statementstmt 100% 33 / 33 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod 100% 6 / 6 totaltotal 100% 51 / 51 CC 2 SCAR 1.7
CC
2
Cov
100%
email
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Newsletter/Base.pm ↑ Summary Newsletter/Categories.pm »
1 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package WebService::SendGrid::Newsletter::Lists;
4  
5 8 ▶use WebService::SendGrid::Newsletter::Lists::Email;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 8 ▶use parent 'WebService::SendGrid::Newsletter::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 3 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
10 3 my ($class, %args) = @_;
11  
12 3 my $self = {};
13 3 bless($self, $class);
14  
15 3 $self->{sgn} = $args{sgn};
16  
17 3 return $self;
18 }
19  
20  
21 5 ▶sub add {
Subroutine add: called CC=1 SCAR=0.0
Pod documented
22 5 my ($self, %args) = @_;
23  
24 5 $self->_check_required_args([ qw( list ) ], %args);
25  
26 4 return $self->{sgn}->_send_request('lists/add', %args);
27 }
28  
29  
30 2 ▶sub get {
Subroutine get: called CC=1 SCAR=0.0
Pod documented
31 2 my ($self, %args) = @_;
32  
33 2 return $self->{sgn}->_send_request('lists/get', %args);
34 }
35  
36  
37 1 ▶sub edit {
Subroutine edit: called CC=1 SCAR=0.0
Pod documented
38 1 my ($self, %args) = @_;
39  
40 1 $self->_check_required_args([ qw( list newlist ) ], %args);
41  
42 1 return $self->{sgn}->_send_request('lists/edit', %args);
43 }
44  
45  
46 4 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
Pod documented
47 4 my ($self, %args) = @_;
48  
49 4 $self->_check_required_args([ qw( list ) ], %args);
50  
51 3 return $self->{sgn}->_send_request('lists/delete', %args);
52 }
53  
54  
55 3 ▶sub email {
Subroutine email: called CC=2 SCAR=6.9
Pod documented
56 3 my ($self) = @_;
57
58 3 ▶ if (!defined $self->{email}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"email"}) 2 1 3
59 $self->{email} = WebService::SendGrid::Newsletter::Lists::Email->new(
60 sgn => $self->{sgn}
61 2 );
62 }
63
64 3 return $self->{email};
65 }
66  
67 8 1;
68  
69 __END__
« Newsletter/Base.pm ↑ Summary Newsletter/Categories.pm »