API/Recurring.pm

filter: Statementstmt 92.0% 23 / 25 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod n/a totaltotal 90.9% 30 / 33 CC 1 SCAR 1.5
CC
1
Cov
93%
_build_autobill
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« API/Client/Contact.pm ↑ Summary API/Estimate.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::Recurring;
5 8 $Net::FreshBooks::API::Recurring::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 8 with 'Net::FreshBooks::API::Role::LineItem';
10  
11 8 ▶use Net::FreshBooks::API::Recurring::AutoBill;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 8 for ( sort keys %{ _fields() } ) {
14 248 ▶ has $_ => ( is => _fields()->{$_}->{is} ) if $_ ne 'autobill';
Branch: 1 branch
BranchTrueFalseTotal
if $_ ne "autobill" 240 8 248
15 }
16  
17 8 has 'autobill' => (
18 is => 'rw',
19 builder => '_build_autobill',
20 );
21  
22 0 ▶sub _build_autobill {
Subroutine _build_autobill: not called CC=1 SCAR=6.9
23  
24 0 my $self = shift;
25 0 return Net::FreshBooks::API::Recurring::AutoBill->new;
26 }
27  
28 248 ▶sub _fields {
Subroutine _fields: called CC=1 SCAR=0.0
29  
30 return {
31  
32 248 amount => { is => 'ro' },
33 client_id => { is => 'rw' },
34 contacts => {
35 is => 'rw',
36 made_of => 'Net::FreshBooks::API::Client::Contact',
37 presented_as => 'array',
38 },
39 currency_code => { is => 'rw' },
40 date => { is => 'rw' },
41 discount => { is => 'rw' },
42 first_name => { is => 'rw' },
43 language => { is => 'rw' },
44 last_name => { is => 'rw' },
45 notes => { is => 'rw' },
46 organization => { is => 'rw' },
47 p_city => { is => 'rw' },
48 p_code => { is => 'rw' },
49 p_country => { is => 'rw' },
50 p_state => { is => 'rw' },
51 p_street1 => { is => 'rw' },
52 p_street2 => { is => 'rw' },
53 po_number => { is => 'rw' },
54 status => { is => 'ro' },
55 terms => { is => 'rw' },
56 vat_name => { is => 'rw' },
57 vat_number => { is => 'rw' },
58  
59 # custom fields
60 # autobill will need to be an object similar to InvoiceLine
61 autobill => {
62 is => 'rw',
63 made_of => 'Net::FreshBooks::API::Recurring::AutoBill',
64 presented_as => 'object',
65 },
66 frequency => { is => 'rw' },
67 lines => {
68 is => 'rw',
69 made_of => 'Net::FreshBooks::API::InvoiceLine',
70 presented_as => 'array',
71 },
72 occurrences => { is => 'rw' },
73 recurring_id => { is => 'ro' },
74 return_uri => { is => 'rw' },
75 send_email => { is => 'rw' },
76 send_snail_mail => { is => 'rw' },
77 stopped => { is => 'rw' },
78 };
79 }
80  
81 8 __PACKAGE__->meta->make_immutable();
82  
83 8 1;
84  
85 # ABSTRACT: FreshBooks Recurring Item access
86  
87 __END__
« API/Client/Contact.pm ↑ Summary API/Estimate.pm »