Toader/Render/supportedObjects.pm

filter: Statementstmt 44.0% 11 / 25 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 100% 2 / 2 totaltotal 47.0% 16 / 34 CC 2 SCAR 10.4
CC
2
Cov
41%
isSupported
6.0
new
2.0
BEGIN
1.0
CRAP 2.8
« Toader/Render/supportedBackends.pm ↑ Summary Toader/Render/Gallery.pm »
1 package Toader::Render::supportedObjects;
2  
3 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use base 'Error::Helper';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 =head1 NAME
8  
9 Toader::Render::supportedObjects - This checks if a object is supported or not for rendering.
10  
11 =head1 VERSION
12  
13 Version 0.1.0
14  
15 =cut
16  
17 5 our $VERSION = '0.1.0';
18  
19 =head1 SYNOPSIS
20  
21 =head1 METHODS
22  
23 =head2 new
24  
25 This initiates the object.
26  
27 my $foo=Toader::Render::supportedObjects->new;
28 if($foo->error){
29 warn('error: '.$foo->error.":".$foo->errorString);
30 }
31  
32 =cut
33  
34 0 ▶sub new{
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
35 0 my $self={
36 error=>undef,
37 errorString=>'',
38 perror=>undef,
39 errorExtra=>{
40 flags=>{
41 1=>'noObj',
42 },
43 },
44 };
45 0 bless $self;
46  
47 0 return $self;
48 }
49  
50 =head2 isSupported
51  
52 This checks if a object is supported or not.
53  
54 One argument is required and it is the object to check.
55  
56 Error checking is only needed as long as what is passed
57 is known to be defined.
58  
59 my $supported=$foo->isSupported( $obj );
60 if ( $foo->error ){
61 warn( 'Error:'.$foo->error.': '.$foo->errorString );
62 }else{
63 if ( $supported ){
64 print "The object is supported.\n";
65 }
66 }
67  
68 =cut
69  
70 0 ▶sub isSupported{
Subroutine isSupported: not called CC=2 SCAR=17.9
Pod documented
71 0 my $self=$_[0];
72 0 my $obj=$_[1];
73  
74 0 $self->errorblank;
75  
76 0 ▶ if ( ! defined( $obj ) ){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $obj) 0 0 0
77 0 $self->{error}=1;
78 0 $self->{errorString}='No object passed';
79 0 $self->warn;
80 0 return undef;
81 }
82  
83 0 my $toaderRenderable=0;
84 0 eval( '$toaderRenderable=$obj->toaderRenderable;' );
85  
86 0 return $toaderRenderable;
87 }
88  
89 =head1 ERROR CODES
90  
91 =head2 1, noObj
92  
93 No object has been passed.
94  
95 =head1 AUTHOR
96  
97 Zane C. Bowers-Hadley, C<< <vvelox at vvelox.net> >>
98  
99 =head1 BUGS
100  
101 Please report any bugs or feature requests to C<bug-toader at rt.cpan.org>, or through
102 the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Toader>. I will
103 be notified, and then you'll automatically be notified of progress on your bug as I make
104 changes.
105  
106 =head1 SUPPORT
107  
108 You can find documentation for this module with the perldoc command.
109  
110 perldoc Toader::Render::supportedObjects
111  
112 You can also look for information at:
113  
114 =over 4
115  
116 =item * RT: CPAN's request tracker
117  
118 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Toader>
119  
120 =item * AnnoCPAN: Annotated CPAN documentation
121  
122 L<http://annocpan.org/dist/Toader>
123  
124 =item * CPAN Ratings
125  
126 L<http://cpanratings.perl.org/d/Toader>
127  
128 =item * Search CPAN
129  
130 L<http://search.cpan.org/dist/Toader/>
131  
132 =back
133  
134 =head1 ACKNOWLEDGEMENTS
135  
136 =head1 LICENSE AND COPYRIGHT
137  
138 Copyright 2013. Zane C. Bowers-Hadley.
139  
140 This program is free software; you can redistribute it and/or modify it
141 under the terms of either: the GNU General Public License as published
142 by the Free Software Foundation; or the Artistic License.
143  
144 See http://dev.perl.org/licenses/ for more information.
145  
146 =cut
147  
148 5 1; # End of Toader::Render::supportedObjects
« Toader/Render/supportedBackends.pm ↑ Summary Toader/Render/Gallery.pm »