CPI/Role/Item.pm

filter: Statementstmt 100% 19 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 100% 23 / 23 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« CPI/Role/Gateway/Base.pm ↑ Summary CPI/Role/Status.pm »
1 package Business::CPI::Role::Item;
2 # ABSTRACT: Role to represent a product in the cart
3 4 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use Business::CPI::Util::Types qw/Money/;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use Types::Standard qw/Str Int Num/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 our $VERSION = '0.924'; # VERSION
8  
9 4 has id => (
10 coerce => Str->coercion,
11 isa => Str,
12 is => 'ro',
13 required => 1,
14 );
15  
16 4 has price => (
17 coerce => Money->coercion,
18 isa => Money,
19 is => 'ro',
20 required => 1,
21 );
22  
23 4 has weight => (
24 coerce => Num->coercion,
25 isa => Num,
26 is => 'ro',
27 );
28  
29 4 has shipping => (
30 coerce => Money->coercion,
31 isa => Money,
32 is => 'ro',
33 predicate => 1,
34 );
35  
36 4 has shipping_additional => (
37 coerce => Money->coercion,
38 isa => Money,
39 is => 'ro',
40 predicate => 1,
41 );
42  
43 4 has description => (
44 coerce => Str->coercion,
45 isa => Str,
46 is => 'ro',
47 );
48  
49 has quantity => (
50 coercion => Int->coercion,
51 isa => Int,
52 is => 'ro',
53 2 ▶ default => sub { 1 },
Subroutine __ANON__: called CC=1 SCAR=0.0
54 4 );
55  
56 4 1;
57  
58 __END__
« CPI/Role/Gateway/Base.pm ↑ Summary CPI/Role/Status.pm »