Devel/IPerl/Display/Role/WebImage.pm

filter: Statementstmt 91.3% 21 / 23 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 84.3% 27 / 32 CC 3 SCAR 7.7
CC
3
Cov
85%
iperl_data_representations
3.3
BEGIN
1.0
BEGIN
1.0
CRAP 2.2
« Reply/Plugin/IPerl.pm ↑ Summary Devel/IPerl/ExecutionResult.pm »
1 # ABSTRACT: A role for image objects that is used to generate HTML with parameters such as geometry.
2 package Devel::IPerl::Display::Role::WebImage;
3 2 $Devel::IPerl::Display::Role::WebImage::VERSION = '0.012';
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 with qw(Devel::IPerl::Display::Role::Displayable);
10  
11 2 requires '_as_text_plain';
12 2 requires 'mimetype';
13  
14 2 has [ qw[width height] ] => ( is => 'rw', predicate => 1 );
15  
16 5 ▶sub iperl_data_representations {
Subroutine iperl_data_representations: called CC=3 SCAR=12.0
Pod undocumented
17 5 my ($self) = @_;
18 5 my $data = $self->_data; # TODO when data is not retrievable
19 return {
20 5 $self->mimetype => $data,
21 "text/plain" => $self->_as_text_plain,
22 "text/html" => qq|<img
23 0 ▶ @{[ $self->has_width ? qq,width="@{[$self->width]}", : "" ]}
Branch: 1 branch
BranchTrueFalseTotal
$self->has_width ? : 0 5 5
24 0 ▶ @{[ $self->has_height ? qq,height="@{[$self->height]}", : "" ]}
Branch: 1 branch
BranchTrueFalseTotal
$self->has_height ? : 0 5 5
25 5 src="@{[ $self->_html_uri ]}" />|,
26 };
27 }
28  
29 2 1;
30  
31 __END__
« Reply/Plugin/IPerl.pm ↑ Summary Devel/IPerl/ExecutionResult.pm »