lib/WebService/Braintree/Address.pm

filter: Statementstmt 80.0% 16 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 100% 4 / 4 totaltotal 80.6% 25 / 31 CC 1 SCAR 2.5
CC
1
Cov
80%
update
2.0
delete
2.0
BEGIN
1.0
CRAP 1.3
« lib/WebService/Braintree/Role/AdvancedSearch.pm ↑ Summary lib/WebService/Braintree/_/Address.pm »
1 # vim: sw=4 ts=4 ft=perl
2  
3 package WebService::Braintree::Address;
4 22 $WebService::Braintree::Address::VERSION = '1.7';
5 22 ▶use 5.010_001;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 22 ▶use strictures 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 =head1 NAME
9  
10 WebService::Braintree::Address
11  
12 =head1 PURPOSE
13  
14 This class creates, updates, deletes, and finds addresses.
15  
16 =cut
17  
18 22 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 22 with 'WebService::Braintree::Role::Interface';
21  
22 =head1 CLASS METHODS
23  
24 =head2 create()
25  
26 This takes a hashref of parameters and returns a L<response|WebService::Braintee::Result> with the C<< address() >> set.
27  
28 =cut
29  
30 1 ▶sub create {
Subroutine create: called CC=1 SCAR=0.0
Pod documented
31 1 my($class, $params) = @_;
32 1 $class->gateway->address->create($params);
33 }
34  
35 =head2 find()
36  
37 This takes a customer_id and an address_id and returns a L<response|WebService::Braintee::Result> with the C<< address() >> set (if found).
38  
39 =cut
40  
41 4 ▶sub find {
Subroutine find: called CC=1 SCAR=0.0
Pod documented
42 4 my ($class, $customer_id, $address_id) = @_;
43 4 $class->gateway->address->find($customer_id, $address_id);
44 }
45  
46 =head2 update()
47  
48 This takes a customer_id, an address_id, and a hashref of parameters. It will
49 update the corresponding address (if found) and return a L<response|WebService::Braintee::Result> with the updated C<< address() >> (if found).
50  
51 =cut
52  
53 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
Pod documented
54 0 my ($class, $customer_id, $address_id, $params) = @_;
55 0 $class->gateway->address->update($customer_id, $address_id, $params);
56 }
57  
58 =head2 delete()
59  
60 This takes a customer_id and an address_id and deletes the corresponding
61 address (if found). It returns a L<response|WebService::Braintee::Result>.
62  
63 =cut
64  
65 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
Pod documented
66 0 my ($class, $customer_id, $address_id) = @_;
67 0 $class->gateway->address->delete($customer_id, $address_id);
68 }
69  
70 22 __PACKAGE__->meta->make_immutable;
71  
72 22 1;
73 __END__
« lib/WebService/Braintree/Role/AdvancedSearch.pm ↑ Summary lib/WebService/Braintree/_/Address.pm »