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