File Coverage

blib/lib/MetaCPAN/Client/Cover.pm
Criterion Covered Total %
statement 10 10 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 14 14 100.0


line stmt bran cond sub pod time code
1 19     19   139 use strict;
  19         44  
  19         614  
2 19     19   118 use warnings;
  19         41  
  19         844  
3             package MetaCPAN::Client::Cover;
4             # ABSTRACT: A Cover data object
5             $MetaCPAN::Client::Cover::VERSION = '2.029000';
6 19     19   127 use Moo;
  19         57  
  19         96  
7              
8             with 'MetaCPAN::Client::Role::Entity';
9              
10             my %known_fields = (
11             scalar => [qw< distribution release version >],
12             arrayref => [],
13             hashref => [qw< criteria >],
14             );
15              
16             my @known_fields =
17             map { @{ $known_fields{$_} } } qw< scalar arrayref hashref >;
18              
19             foreach my $field (@known_fields) {
20             has $field => (
21             is => 'ro',
22             lazy => 1,
23             default => sub {
24             my $self = shift;
25             return $self->data->{$field};
26             },
27             );
28             }
29              
30 2     2   8 sub _known_fields { return \%known_fields }
31              
32             1;
33              
34             __END__