File Coverage

blib/lib/Devel/IPerl/Display/AudioMPEG.pm
Criterion Covered Total %
statement 12 18 66.6
branch 0 2 0.0
condition n/a
subroutine 4 6 66.6
pod 0 1 0.0
total 16 27 59.2


line stmt bran cond sub pod time code
1             $Devel::IPerl::Display::AudioMPEG::VERSION = '0.012';
2             use strict;
3 2     2   11 use warnings;
  2         20  
  2         55  
4 2     2   10  
  2         4  
  2         44  
5             use Moo;
6 2     2   8 with qw(Devel::IPerl::Display::Role::Displayable Devel::IPerl::Display::Role::MIMESource);
  2         2  
  2         10  
7             use Try::Tiny;
8 2     2   624  
  2         3  
  2         353  
9             my ($self) = @_;
10 0     0     my $data = $self->_data; # TODO when data is not retrievable
11             return unless defined $data;
12 0     0 0   return {
13 0           $self->mimetype => $data,
14 0 0         "text/plain" => '[MPEG audio]', # TODO get length
15             "text/html" => qq|<audio controls src="@{[ $self->_html_uri ]}" />|,
16 0           };
17             }
18 0            
19             1;
20              
21              
22             =pod
23              
24             =encoding UTF-8
25              
26             =head1 NAME
27              
28             Devel::IPerl::Display::AudioMPEG
29              
30             =head1 VERSION
31              
32             version 0.012
33              
34             =head1 AUTHOR
35              
36             Zakariyya Mughal <zmughal@cpan.org>
37              
38             =head1 COPYRIGHT AND LICENSE
39              
40             This software is copyright (c) 2014 by Zakariyya Mughal.
41              
42             This is free software; you can redistribute it and/or modify it under
43             the same terms as the Perl 5 programming language system itself.
44              
45             =cut