File Coverage

blib/lib/Web/MarketReceipt/Order.pm
Criterion Covered Total %
statement 12 15 80.0
branch n/a
condition n/a
subroutine 4 5 80.0
pod 1 1 100.0
total 17 21 80.9


line stmt bran cond sub pod time code
1             package Web::MarketReceipt::Order;
2 4     4   29 use Mouse;
  4         9  
  4         23  
3 4     4   1470 use Mouse::Util::TypeConstraints;
  4         8  
  4         21  
4 4     4   404 use utf8;
  4         9  
  4         18  
5              
6             enum 'OrderState' => qw/purchased canceled refunded expired/;
7             enum 'OrderEnvironment' => qw/Sandbox Production/;
8              
9             has product_identifier => (
10             is => 'ro',
11             isa => 'Str',
12             required => 1,
13             );
14              
15             has unique_identifier => (
16             is => 'ro',
17             isa => 'Str',
18             required => 1,
19             );
20              
21             has purchased_epoch => (
22             is => 'ro',
23             isa => 'Int',
24             required => 1,
25             );
26              
27             has state => (
28             is => 'ro',
29             isa => 'OrderState',
30             required => 1,
31             );
32              
33             has quantity => (
34             is => 'ro',
35             isa => 'Int',
36             required => 1,
37             );
38              
39             has environment => (
40             is => 'ro',
41             isa => 'OrderEnvironment',
42             required => 1,
43             );
44              
45 4     4   721 no Mouse;
  4         8  
  4         18  
46              
47             sub dump {
48 0     0 1   my $self = shift;
49             +{
50 0           (map {($_ => $self->$_)}
  0            
51             qw/product_identifier unique_identifier purchased_epoch state quantity environment/)
52             };
53             }
54              
55             1;