line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Easypost::Rate; |
2
|
|
|
|
|
|
|
$Net::Easypost::Rate::VERSION = '0.20'; |
3
|
6
|
|
|
6
|
|
41
|
use Moo; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
37
|
|
4
|
|
|
|
|
|
|
with qw(Net::Easypost::Resource); |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
has 'carrier' => ( |
7
|
|
|
|
|
|
|
is => 'ro', |
8
|
|
|
|
|
|
|
default => 'USPS', |
9
|
|
|
|
|
|
|
); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has [qw/service rate shipment_id/] => ( |
12
|
|
|
|
|
|
|
is => 'ro', |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub _build_fieldnames { |
16
|
21
|
|
|
21
|
|
8890
|
return [qw(carrier service rate shipment_id)]; |
17
|
|
|
|
|
|
|
} |
18
|
21
|
|
|
21
|
|
2742
|
sub _build_role { 'rate' } |
19
|
21
|
|
|
21
|
|
394
|
sub _build_operation { '' } |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub serialize { |
22
|
2
|
|
|
2
|
1
|
7
|
my ($self) = @_; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
return { |
25
|
2
|
|
|
|
|
20
|
'rate[id]' => $self->id |
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub clone { |
30
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
return Net::Easypost::Rate->new( |
33
|
0
|
|
|
|
|
|
map { $_ => $self->$_ } |
34
|
0
|
|
|
|
|
|
grep { defined $self->$_ } |
35
|
0
|
|
|
|
|
|
'id', @{ $self->fieldnames } |
|
0
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |