File Coverage

blib/lib/Autocache/Request.pm
Criterion Covered Total %
statement 13 13 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 17 17 100.0


line stmt bran cond sub pod time code
1             package Autocache::Request;
2              
3 5     5   32 use Any::Moose;
  5         7  
  5         50  
4              
5 5     5   3976 use Autocache::Logger qw(get_logger);
  5         12  
  5         1576  
6              
7             has 'name' => (
8             is => 'ro',
9             isa => 'Str',
10             required => 1,
11             );
12              
13             has 'normaliser' => (
14             is => 'ro',
15             required => 1,
16             );
17              
18             has 'generator' => (
19             is => 'ro',
20             required => 1,
21             );
22              
23             has 'args' => (
24             is => 'ro',
25             isa => 'ArrayRef',
26             required => 1,
27             );
28              
29             has 'context' => (
30             is => 'ro',
31             isa => 'Str',
32             required => 1,
33             );
34              
35             has 'key' => (
36             is => 'ro',
37             isa => 'Str',
38             lazy_build => 1,
39             );
40              
41             sub _build_key
42             {
43 129     129   172 my ($self) = @_;
44 129         283 get_logger()->debug( "_build_key" );
45 129         564 return sprintf 'AC-%s-%s-%s',
46             $self->context,
47             $self->name,
48 129         392 $self->normaliser->( @{$self->args} );
49             }
50              
51 5     5   49 no Any::Moose;
  5         9  
  5         30  
52             __PACKAGE__->meta->make_immutable;
53              
54             1;