line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
19
|
|
|
19
|
|
138
|
use strict; |
|
19
|
|
|
|
|
45
|
|
|
19
|
|
|
|
|
599
|
|
2
|
19
|
|
|
19
|
|
101
|
use warnings; |
|
19
|
|
|
|
|
47
|
|
|
19
|
|
|
|
|
858
|
|
3
|
|
|
|
|
|
|
package MetaCPAN::Client::Rating; |
4
|
|
|
|
|
|
|
# ABSTRACT: A Rating data object |
5
|
|
|
|
|
|
|
$MetaCPAN::Client::Rating::VERSION = '2.029000'; |
6
|
19
|
|
|
19
|
|
114
|
use Moo; |
|
19
|
|
|
|
|
49
|
|
|
19
|
|
|
|
|
116
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
with 'MetaCPAN::Client::Role::Entity'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my %known_fields = ( |
11
|
|
|
|
|
|
|
scalar => [qw< |
12
|
|
|
|
|
|
|
author |
13
|
|
|
|
|
|
|
date |
14
|
|
|
|
|
|
|
details |
15
|
|
|
|
|
|
|
distribution |
16
|
|
|
|
|
|
|
helpful |
17
|
|
|
|
|
|
|
rating |
18
|
|
|
|
|
|
|
release |
19
|
|
|
|
|
|
|
user |
20
|
|
|
|
|
|
|
>], |
21
|
|
|
|
|
|
|
arrayref => [], |
22
|
|
|
|
|
|
|
hashref => [], |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my @known_fields = |
26
|
|
|
|
|
|
|
map { @{ $known_fields{$_} } } qw< scalar arrayref hashref >; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
foreach my $field (@known_fields) { |
29
|
|
|
|
|
|
|
has $field => ( |
30
|
|
|
|
|
|
|
is => 'ro', |
31
|
|
|
|
|
|
|
lazy => 1, |
32
|
|
|
|
|
|
|
default => sub { |
33
|
|
|
|
|
|
|
my $self = shift; |
34
|
|
|
|
|
|
|
return $self->data->{$field}; |
35
|
|
|
|
|
|
|
}, |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
2
|
|
|
2
|
|
7
|
sub _known_fields { return \%known_fields } |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |