PNG/View.pm

filter: Statementstmt 55.0% 11 / 20 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 57.1% 4 / 7 Podpod 100% 3 / 3 totaltotal 42.8% 18 / 42 SCAR 20.3
CC
4
Cov
39%
new
20.0
png
2.0
print
2.0
CRAP 7.6
« PNG/View/HTML.pm ↑ Summary PNG/View/JSON.pm »
1 package Lego::From::PNG::View;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 BEGIN {
7 2 ▶ $Lego::From::PNG::View::VERSION = '0.01';
Subroutine BEGIN: called CC=1 SCAR=0.0
8 }
9  
10 2 ▶use Data::Debug;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 sub new {
13 0 ▶ my $class = shift;
Subroutine new: not called CC=4 SCAR=30.0
Pod documented
14 0 my $png = shift;
15 0 ▶ die 'Lego::From::PNG object was not supplied' unless $png && ref($png) eq 'Lego::From::PNG';
Branch: 1 branch
BranchTrueFalseTotal
unless $png and ref $png eq "Lego::From::PNG" 0 0 0
Condition0%0/3
$png and ref $png eq "Lego::From::PNG"
!ll&&!rl&&r
000
MC/DC0%0/2
$png and ref $png eq "Lego::From::PNG"
$png ref $png eq "Lego::From::PNG"
Truth table0%0/3
A and B
A= $pngB= ref $png eq "Lego::From::PNG"
ABresult
0X0
100
111
16  
17 0 my $hash = { png => $png };
18  
19 0 ▶ my $self = bless ($hash, ref ($class) || $class);
Condition0%0/3
ref $class || $class
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table0%0/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
20  
21 0 return $self;
22 }
23  
24 0 ▶sub png { shift->{'png'} }
Subroutine png: not called CC=1 SCAR=6.9
Pod documented
25  
26 sub print {
27 0 ▶ my $self = shift;
Subroutine print: not called CC=1 SCAR=6.9
Pod documented
28  
29 0 return @_; # Don't do anything, just return what they send us
30 }
31  
32 =pod
33  
34 =head1 NAME
35  
36 Lego::From::PNG::View - Format data returned from Lego::From::PNG
37  
38 =head1 SYNOPSIS
39  
40 use Lego::From::PNG;
41  
42 my $object = Lego::From::PNG->new({ filename => 'my_png.png' });
43  
44 $object->process(view => 'JSON'); # Data is returned as JSON
45  
46 =head1 DESCRIPTION
47  
48 Base class for formatting data returned from processing a PNG
49  
50 =head1 USAGE
51  
52 =head2 new
53  
54 Usage : ->new($png)
55 Purpose : Returns Lego::From::PNG::View object
56  
57 Returns : Lego::From::PNG::View object
58 Argument : L<Lego::From::PNG> object is required as input
59 Throws :
60  
61 Comment : This is just a base class so this shouldn't be directly used to format data
62 See Also :
63  
64 =head2 png
65  
66 Usage : ->png()
67 Purpose : Returns the L<Lego::From::PNG> object passed into the constructor
68  
69 Returns : L<Lego::From::PNG> object
70 Argument :
71 Throws :
72  
73 Comment :
74 See Also :
75  
76 =head2 print
77  
78 Usage : ->print()
79 Purpose : Returns formated input data
80  
81 Returns : In the case of the base class the args passed are just returned back
82 Argument :
83 Throws :
84  
85 Comment :
86 See Also :
87  
88  
89 =head1 BUGS
90  
91 =head1 SUPPORT
92  
93 =head1 AUTHOR
94  
95 Travis Chase
96 CPAN ID: GAUDEON
97 gaudeon@cpan.org
98 https://github.com/gaudeon/Lego-From-Png
99  
100 =head1 COPYRIGHT
101  
102 This program is free software licensed under the...
103  
104 The MIT License
105  
106 The full text of the license can be found in the
107 LICENSE file included with this module.
108  
109 =head1 SEE ALSO
110  
111 perl(1).
112  
113 =cut
114  
115 2 1;
116  
« PNG/View/HTML.pm ↑ Summary PNG/View/JSON.pm »