Rakuten/Order/Address.pm

filter: Statementstmt 67.6% 23 / 34 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 37.5% 3 / 8 Podpod 100% 5 / 5 totaltotal 63.2% 31 / 49 CC 2 SCAR 9.4
CC
2
Cov
64%
name
6.0
address1
2.0
address2
2.0
CRAP 2.6
« Rakuten/Response.pm ↑ Summary Rakuten/Order/Item.pm »
1 package Marketplace::Rakuten::Order::Address;
2  
3 3 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use MooX::Types::MooseLike::Base qw(Str);
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 =head1 NAME
8  
9 Marketplace::Rakuten::Order::Address
10  
11 =head1 DESCRIPTION
12  
13 Class to handle the xml structures representing an address.
14  
15 This modules doesn't do much, it just provides an uniform iterface
16 with other Marketplace modules.
17  
18 =head1 ACCESSORS
19  
20 =head2 CONSTRUCTOR ARGUMENTS (from xml)
21  
22 =over 4
23  
24 =item * client_id
25  
26 =item * gender
27  
28 =item * first_name
29  
30 =item * last_name
31  
32 =item * company
33  
34 =item * street
35  
36 =item * street_no
37  
38 =item * address_add
39  
40 =item * zip_code
41  
42 =item * city
43  
44 =item * country
45  
46 =item * email
47  
48 =item * phone
49  
50 =back
51  
52 =cut
53  
54 3 has client_id => (is => 'ro', isa => Str);
55 3 has gender => (is => 'ro', isa => Str);
56 3 has first_name => (is => 'ro', isa => Str);
57 3 has last_name => (is => 'ro', isa => Str);
58 3 has company => (is => 'ro', isa => Str);
59 3 has street => (is => 'ro', isa => Str);
60 3 has street_no => (is => 'ro', isa => Str);
61 3 has address_add => (is => 'ro', isa => Str);
62 3 has zip_code => (is => 'ro', isa => Str);
63 3 has city => (is => 'ro', isa => Str);
64 3 has country => (is => 'ro', isa => Str);
65 3 has email => (is => 'ro', isa => Str);
66 3 has phone => (is => 'ro', isa => Str);
67  
68 =head2 ALIASES
69  
70 =over 4
71  
72 =item address1
73  
74 Concatenation of street and street_no
75  
76 =item address2 (address_add)
77  
78 =item name
79  
80 Concatenation of company, first_name, last_name
81  
82 =item state
83  
84 Always return the empty string, Rakuten doesn't give it.
85  
86 =item zip (zip_code)
87  
88 =back
89  
90 =cut
91  
92 sub address1 {
93 0 ▶ my $self = shift;
Subroutine address1: not called CC=1 SCAR=6.9
Pod documented
94 0 return $self->street . ' ' . $self->street_no;
95 }
96  
97 sub address2 {
98 0 ▶ my $self = shift;
Subroutine address2: not called CC=1 SCAR=6.9
Pod documented
99 0 return $self->address_add;
100 }
101  
102 sub name {
103 0 ▶ my $self = shift;
Subroutine name: not called CC=2 SCAR=17.9
Pod documented
104 0 my $out = '';
105 0 ▶ if ($self->company) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->company) 0 0 0
106 0 $out = $self->company . ' ';
107 }
108 0 return $out . $self->first_name . ' ' . $self->last_name;
109 }
110  
111 sub state {
112 # not provided, apparently
113 0 ▶ return '';
Subroutine state: not called CC=1 SCAR=6.9
Pod documented
114 }
115  
116 sub zip {
117 0 ▶ return shift->zip_code;
Subroutine zip: not called CC=1 SCAR=6.9
Pod documented
118 }
119  
120  
121  
122 3 1;
« Rakuten/Response.pm ↑ Summary Rakuten/Order/Item.pm »