File Coverage

blib/lib/Devel/IPerl/Display/CSS.pm
Criterion Covered Total %
statement 17 18 94.4
branch 3 4 75.0
condition n/a
subroutine 4 5 80.0
pod 0 1 0.0
total 24 28 85.7


line stmt bran cond sub pod time code
1             package Devel::IPerl::Display::CSS;
2             $Devel::IPerl::Display::CSS::VERSION = '0.008';
3 2     2   12 use strict;
  2         4  
  2         50  
4 2     2   8 use warnings;
  2         4  
  2         39  
5              
6 2     2   8 use Moo;
  2         3  
  2         13  
7             with qw(Devel::IPerl::Display::Role::Displayable Devel::IPerl::Display::Role::Source);
8              
9 0     0   0 sub _build_mimetype { 'text/css' }
10             sub iperl_data_representations {
11 2     2 0 27 my ($self) = @_;
12 2         3 my $html;
13 2 100       10 if( $self->uri ) {
    50          
14 1         3 $html = <<"HTML";
15 1         5 <link rel="stylesheet" href="@{[$self->uri]}" type="text/css">
16             HTML
17             } elsif( $self->bytestream ) {
18 1         2 $html = <<"HTML";
19             <stylesheet type="text/css">
20 1         7 @{[ $self->bytestream ]}
21             </stylesheet>
22             HTML
23             }
24             return {
25 2         8 "text/html" => $html,
26             };
27             }
28              
29             1;
30              
31             __END__
32              
33             =pod
34              
35             =encoding UTF-8
36              
37             =head1 NAME
38              
39             Devel::IPerl::Display::CSS
40              
41             =head1 VERSION
42              
43             version 0.008
44              
45             =head1 AUTHOR
46              
47             Zakariyya Mughal <zmughal@cpan.org>
48              
49             =head1 COPYRIGHT AND LICENSE
50              
51             This software is copyright (c) 2014 by Zakariyya Mughal.
52              
53             This is free software; you can redistribute it and/or modify it under
54             the same terms as the Perl 5 programming language system itself.
55              
56             =cut