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