File Coverage

blib/lib/Parse/CPAN/Ratings/Rating.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Parse::CPAN::Ratings::Rating;
2 1     1   12 use Moose;
  1         3  
  1         12  
3 1     1   9279 use MooseX::StrictConstructor;
  1         2  
  1         8  
4              
5             has 'distribution' => ( is => 'ro', isa => 'Str' );
6             has 'rating' => ( is => 'ro', isa => 'Num' );
7             has 'review_count' => ( is => 'ro', isa => 'Int' );
8              
9 1     1   3231 no Moose;
  1         4  
  1         5  
10              
11             __PACKAGE__->meta->make_immutable;
12              
13             __END__
14              
15             =head1 NAME
16              
17             Parse::CPAN::Ratings::Rating - Parse CPAN ratings
18              
19             =head1 SYNOPSIS
20              
21             my $ratings
22             = Parse::CPAN::Ratings->new( filename => 't/all_ratings_100.csv' );
23              
24             my $rating = $ratings->rating('Archive-Zip');
25             print $rating->distribution . "\n"; # Archive-Zip
26             print $rating->rating . "\n"; # 3.8
27             print $rating->review_count . "\n"; # 6
28              
29             =head1 DESCRIPTION
30              
31             This module represents a CPAN rating.
32              
33             =head1 SEE ALSO
34              
35             L<Parse::CPAN::Ratings>.
36              
37             =head1 AUTHOR
38              
39             Leon Brocard <acme@astray.com>.
40              
41             =head1 COPYRIGHT
42              
43             Copyright (C) 2009, Leon Brocard
44              
45             =head1 LICENSE
46              
47             This module is free software; you can redistribute it or modify it
48             under the same terms as Perl itself.