Stripe/Connect/Account/ExternalAccounts.pm

filter: Statementstmt 29.6% 8 / 27 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 3 / 6 Podpod 100% 1 / 1 totaltotal 26.0% 12 / 46 CC 7 SCAR 31.1
CC
7
Cov
22%
data
42.0
__ANON__
6.0
__ANON__
2.0
CRAP 22.4
« Stripe/Connect/Person.pm ↑ Summary Stripe/Product/PackageDimension.pm »
1 ##----------------------------------------------------------------------------
2 ## Stripe API - ~/lib/Net/API/Stripe/Connect/Account/ExternalAccounts.pm
3 ## Version v0.100.0
4 ## Copyright(c) 2019 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <@sitael.tokyo.deguest.jp>
6 ## Created 2019/11/02
7 ## Modified 2020/05/15
8 ##
9 ##----------------------------------------------------------------------------
10 package Net::API::Stripe::Connect::Account::ExternalAccounts;
11 BEGIN
12 {
13 1 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶ use parent qw( Net::API::Stripe::List );
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶ our( $VERSION ) = 'v0.100.0';
Subroutine BEGIN: called CC=1 SCAR=0.0
16 };
17  
18 # Inhertied
19 # sub object { shift->_set_get_scalar( 'object', @_ ); }
20  
21 ## The list contains all external accounts that have been attached to the Stripe account. These may be bank accounts or cards.
22 ## sub data { shift->_set_get_array( 'data', @_ ); }
23 sub data
24 {
25 0 ▶ my $self = shift( @_ );
Subroutine data: not called CC=6 SCAR=37.4
Pod documented
26 0 ▶ if( @_ )
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
27 {
28 local $process = sub
29 {
30 0 ▶ my $ref = shift( @_ );
Subroutine __ANON__: not called CC=2 SCAR=17.9
31 0 ▶ my $type = $ref->{object} || return( $self->error( "No object type could be found in hash: ", sub{ $self->_dumper( $ref ) } ) );
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/2
$ref->{'object'} || (return $self->error('No object type could be found in hash: ', sub {
l!l
00
MC/DC0%0/1
$ref->{'object'} || (return $self->error('No object type could be found in hash: ', sub { $self->_dumper($ref); } ))
$ref->{'object'}
Truth table0%0/2
A
A= $ref->{'object'}
Aresult
11
00
32 0 my $class = $self->_object_type_to_class( $type );
33 0 $self->_message( 3, "Object type $type has class $class" );
34 0 my $o = $self->_instantiate_object( 'data', $class, $ref );
35 0 $self->{data} = $o;
36 ## return( $class->new( %$ref ) );
37 ## return( $self->_set_get_object( 'object', $class, $ref ) );
38 0 };
39
40 0 ▶ if( ref( $_[0] ) eq 'HASH' )
Branch: 2 branches
BranchTrueFalseTotal
if (ref $_[0] eq 'HASH') { } 0 0 0
elsif (ref $_[0] eq 'ARRAY') { } 0 0 0
41 {
42 0 my $o = $process->( @_ )
43 }
44 ## An array of objects hash
45 elsif( ref( $_[0] ) eq 'ARRAY' )
46 {
47 0 my $arr = shift( @_ );
48 0 my $res = [];
49 0 foreach my $data ( @$arr )
50 {
51 0 ▶ my $o = $process->( $data ) || return( $self->error( "Unable to create object: ", $self->error ) );
Condition0%0/2
&$process($data) || (return $self->error('Unable to create object: ', $self->error))
l!l
00
MC/DC0%0/1
&$process($data) || (return $self->error('Unable to create object: ', $self->error))
&$process($data)
Truth table0%0/2
A
A= &$process($data)
Aresult
11
00
52 0 push( @$res, $o );
53 }
54 0 $self->{data} = $res;
55 }
56 }
57 0 return( $self->{data} );
58 }
59  
60 # Inhertied
61 # sub has_more { shift->_set_get_scalar( 'has_more', @_ ); }
62  
63 # Inhertied
64 # sub total_count { shift->_set_get_scalar( 'total_count', @_ ); }
65  
66 # Inhertied
67 # sub url { shift->_set_get_uri( 'url', @_ ); }
68  
69 1 1;
70  
71 __END__
72  
73 =encoding utf8
74  
75 =head1 NAME
76  
77 Net::API::Stripe::Connect::Account::ExternalAccounts - A Stripe External Accounts List Object
78  
79 =head1 VERSION
80  
81 v0.100.0
82  
83 =head1 DESCRIPTION
84  
85 This module inherits everything from L<Net::API::Stripe::List> module and overrides only the B<data> method
86  
87 This is instantiated from method B<external_accounts> in module L<Net::API::Stripe::Connect::Account>
88  
89 =head1 AUTHOR
90  
91 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
92  
93 =head1 SEE ALSO
94  
95 Stripe API documentation:
96  
97 L<https://stripe.com/docs/api>
98  
99 =head1 COPYRIGHT & LICENSE
100  
101 Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
102  
103 You can use, copy, modify and redistribute this package and associated
104 files under the same terms as Perl itself.
105  
106 =cut
« Stripe/Connect/Person.pm ↑ Summary Stripe/Product/PackageDimension.pm »