File Coverage

blib/lib/Image/OpenALPR/PlateResult.pm
Criterion Covered Total %
statement 11 21 52.3
branch 0 8 0.0
condition n/a
subroutine 4 6 66.6
pod 1 2 50.0
total 16 37 43.2


line stmt bran cond sub pod time code
1             package Image::OpenALPR::PlateResult;
2              
3 1     1   12 use 5.014000;
  1         2  
4 1     1   3 use strict;
  1         1  
  1         18  
5 1     1   2 use warnings;
  1         1  
  1         22  
6              
7 1     1   384 use parent qw/Class::Accessor::Fast/;
  1         218  
  1         3  
8              
9             our $VERSION = '0.001';
10              
11             __PACKAGE__->mk_ro_accessors(qw/plate confidence matches_template/);
12              
13             sub coordinates {
14 0     0 0   my $coords = shift->{coordinates};
15 0 0         return unless $coords;
16 0           my @result = map { [$_->{x}, $_->{y}] } @$coords;
  0            
17 0 0         wantarray ? @result : \@result
18             }
19              
20             sub candidates {
21 0     0 1   my $cands = shift->{candidates};
22 0 0         return unless $cands;
23 0           my @result = map { __PACKAGE__->new($_) } @$cands;
  0            
24 0 0         wantarray ? @result : \@result
25             }
26              
27             1;
28             __END__