PNG/View/JSON.pm

filter: Statementstmt 80.9% 17 / 21 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 100% 1 / 1 totaltotal 77.4% 24 / 31 SCAR 7.3
CC
2
Cov
74%
print
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.1
« PNG/View.pm ↑ Summary PNG.pm »
1 package Lego::From::PNG::View::JSON;
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::VERSION = '0.01';
Subroutine BEGIN: called CC=1 SCAR=0.0
8 }
9  
10 2 ▶use parent qw(Lego::From::PNG::View);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 ▶use Data::Debug;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 2 ▶use JSON;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 sub print {
17 0 ▶ my $self = shift;
Subroutine print: not called CC=2 SCAR=17.9
Pod documented
18 0 ▶ my %args = ref $_[0] eq 'HASH' ? %{$_[0]} : @_;
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] eq 'HASH' ? : 0 0 0
19  
20 0 return JSON->new->utf8->pretty->encode( \%args );
21 }
22  
23 =pod
24  
25 =head1 NAME
26  
27 Lego::From::PNG::View::JSON - Format data returned from Lego::From::PNG
28  
29 =head1 SYNOPSIS
30  
31 use Lego::From::PNG;
32  
33 my $object = Lego::From::PNG->new({ filename => 'my_png.png' });
34  
35 $object->process(view => 'JSON'); # Data is returned as JSON
36  
37 =head1 DESCRIPTION
38  
39 Class to returned processed data in JSON format
40  
41 =head1 USAGE
42  
43 =head2 new
44  
45 Usage : ->new()
46 Purpose : Returns Lego::From::PNG::View::JSON object
47  
48 Returns : Lego::From::PNG::View::JSON object
49 Argument :
50 Throws :
51  
52 Comment :
53 See Also :
54  
55 =head2 print
56  
57 Usage : ->print({}) or ->print(key1 => val1, key2 => val2)
58 Purpose : Returns JSON formated data (in utf8 and pretty format)
59  
60 Returns : Returns JSON formated data (in utf8 and pretty format)
61 Argument :
62 Throws :
63  
64 Comment :
65 See Also :
66  
67  
68 =head1 BUGS
69  
70 =head1 SUPPORT
71  
72 =head1 AUTHOR
73  
74 Travis Chase
75 CPAN ID: GAUDEON
76 gaudeon@cpan.org
77 https://github.com/gaudeon/Lego-From-Png
78  
79 =head1 COPYRIGHT
80  
81 This program is free software licensed under the...
82  
83 The MIT License
84  
85 The full text of the license can be found in the
86 LICENSE file included with this module.
87  
88 =head1 SEE ALSO
89  
90 perl(1).
91  
92 =cut
93  
94 2 1;
95  
« PNG/View.pm ↑ Summary PNG.pm »