File Coverage

blib/lib/Audio/APETags.pm
Criterion Covered Total %
statement 14 17 82.3
branch 2 6 33.3
condition n/a
subroutine 5 6 83.3
pod 0 3 0.0
total 21 32 65.6


line stmt bran cond sub pod time code
1             package Audio::APETags;
2              
3             # Base class wrapper.
4              
5 1     1   7 use strict;
  1         6  
  1         29  
6 1     1   5706 use Audio::Scan;
  1         2597  
  1         267  
7              
8             our $VERSION = '1.0';
9              
10             sub new {
11 2     2 0 1063 my ($class, $file) = @_;
12              
13 2 50       7 my $method = ref $file ? 'scan_fh' : 'scan';
14 2         13 my $self = Audio::Scan->$method($file);
15              
16 2         640 bless $self, $class;
17              
18 2         8 return $self;
19             }
20              
21             sub _extract {
22 2     2   6 my ($self, $type, $key) = @_;
23              
24 2 50       11 return $self->{$type} unless $key;
25 0 0       0 return $self->{$type}{ucfirst $key} if defined $self->{$type}{ucfirst $key};
26 0         0 return $self->{$type}{$key};
27             }
28              
29             sub info {
30 0     0 0 0 return shift->_extract('info', @_);
31             }
32              
33             sub tags {
34 2     2 0 1150 return shift->_extract('tags', @_);
35             }
36              
37             1;
38              
39             __END__