Delivery/Provider/IOHandle.pm untested

filter: Statementstmt 0.0% 0 / 21 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 34 CC 3 SCAR 16.7
CC
3
Cov
0%
new
12.0
BEGIN
2.0
BEGIN
2.0
CRAP 5.3
1 package Image::Delivery::Provider::IOHandle;
2  
3 use strict;
4 use UNIVERSAL 'isa';
5 use base 'Image::Delivery::Provider::Scalar';
6 use File::Slurp ();
7  
8 use vars qw{$VERSION};
9 BEGIN {
10 $VERSION = '0.14';
11 }
12  
13  
14  
15  
16  
17 #####################################################################
18 # Constructor
19  
20 sub new {
21 my $class = shift;
22 my $handle = isa(ref $_[0], 'IO::Handle') ? shift : return undef;
23  
24 # Slurp in the image
25 my $image = File::Slurp::read_file( $handle, scalar_ref => 1 );
26 return undef unless ref $image eq 'SCALAR';
27  
28 # Hand off to our parent
29 $class->SUPER::new( $image, @_ );
30 }
31  
32 1;