API/Client.pm

filter: Statementstmt 80.9% 17 / 21 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 80.0% 4 / 5 Podpod 100% 1 / 1 totaltotal 73.3% 22 / 30 CC 2 SCAR 9.8
CC
2
Cov
74%
add_contact
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« API/Recurring/AutoBill.pm ↑ Summary API/Recurring/AutoBill/Card/Expiration.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  
4 package Net::FreshBooks::API::Client;
5 8 $Net::FreshBooks::API::Client::VERSION = '0.24';
6 8 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 8 extends 'Net::FreshBooks::API::Base';
8 8 with 'Net::FreshBooks::API::Role::CRUD';
9  
10 8 has $_ => ( is => _fields()->{$_}->{is} ) for sort keys %{ _fields() };
11  
12 272 ▶sub _fields {
Subroutine _fields: called CC=1 SCAR=0.0
13 return {
14 272 client_id => { is => 'ro' },
15 first_name => { is => 'rw' },
16 last_name => { is => 'rw' },
17 organization => { is => 'rw' },
18 email => { is => 'rw' },
19 username => { is => 'rw' },
20 contacts => {
21 is => 'rw',
22 made_of => 'Net::FreshBooks::API::Client::Contact',
23 presented_as => 'array',
24 },
25 password => { is => 'rw' },
26 work_phone => { is => 'rw' },
27 home_phone => { is => 'rw' },
28 mobile => { is => 'rw' },
29 fax => { is => 'rw' },
30 language => { is => 'rw' },
31 currency_code => { is => 'rw' },
32 credit => { is => 'ro' },
33 notes => { is => 'rw' },
34  
35 p_street1 => { is => 'rw' },
36 p_street2 => { is => 'rw' },
37 p_city => { is => 'rw' },
38 p_state => { is => 'rw' },
39 p_country => { is => 'rw' },
40 p_code => { is => 'rw' },
41  
42 s_street1 => { is => 'rw' },
43 s_street2 => { is => 'rw' },
44 s_city => { is => 'rw' },
45 s_state => { is => 'rw' },
46 s_country => { is => 'rw' },
47 s_code => { is => 'rw' },
48  
49 links => {
50 is => 'ro',
51 made_of => 'Net::FreshBooks::API::Links',
52 presented_as => 'single',
53 },
54  
55 vat_name => { is => 'rw' },
56 vat_number => { is => 'rw' },
57 folder => { is => 'ro' },
58 updated => { is => 'ro' },
59  
60 };
61 }
62  
63 0 ▶sub add_contact {
Subroutine add_contact: not called CC=2 SCAR=17.9
Pod documented
64 0 my $self = shift;
65 0 my $args = shift;
66 0 ▶ push @{ $self->{contacts} ||= [] },
Condition0%0/2
$self->{"contacts"} ||= []
l!l
00
MC/DC0%0/1
$self->{"contacts"} ||= []
$self->{"contacts"}
Truth table0%0/2
A
A= $self->{"contacts"}
Aresult
11
00
67 Net::FreshBooks::API::Client::Contact->new( $args );
68 }
69  
70 8 __PACKAGE__->meta->make_immutable();
71  
72 8 1;
73  
74 # ABSTRACT: FreshBooks Client access
75  
76 __END__
« API/Recurring/AutoBill.pm ↑ Summary API/Recurring/AutoBill/Card/Expiration.pm »