Articulate/File.pm

filter: Statementstmt 80.9% 17 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod n/a totaltotal 77.7% 21 / 27 CC 1 SCAR 1.6
CC
1
Cov
81%
_to_string
2.0
BEGIN
1.0
__ANON__
1.0
CRAP 1.2
« Articulate/Service/LoginForm.pm ↑ Summary Articulate/Authorisation/AlwaysAllow.pm »
1 package Articulate::File;
2 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 11 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 11 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 0 ▶use overload '""' => sub { shift->_to_string };
Subroutine BEGIN: called CC=1 SCAR=0.2
Subroutine __ANON__: not called CC=1 SCAR=0.2
6  
7 =head1 NAME
8  
9 Articulate::File - represent a file
10  
11 =cut
12  
13 =head1 DESCRIPTION
14  
15 This represents a binary blob of content which is uploaded as a file
16 and should ideally be moved straight into the database rather than
17 loaded into memory.
18  
19 It may also in future be used to represent files on the way out. The
20 interface is currently unstable as it is largely copied from Dancer's
21 file handling and is written to 'what works'.
22  
23 =head1 ATTRIBUTES
24  
25 =cut
26  
27 =head3 content_type
28  
29 The MIME type of the content.
30  
31 =cut
32  
33 11 has content_type => ( is => 'rw', );
34  
35 =head3 headers
36  
37 The HTTP headers which came with the file.
38  
39 =cut
40  
41 11 has headers => ( is => 'rw', );
42  
43 =head3 filename
44  
45 The name of the file.
46  
47 =cut
48  
49 11 has filename => ( is => 'rw', );
50  
51 =head3 io
52  
53 The IO::All object which corresponds to the file handle.
54  
55 =cut
56  
57 11 has io => ( is => 'rw', );
58  
59 0 ▶sub _to_string {
Subroutine _to_string: not called CC=1 SCAR=6.9
60 0 my $self = shift;
61 0 local $/;
62 0 join '', $self->io->getlines;
63 }
64  
65 11 1;
« Articulate/Service/LoginForm.pm ↑ Summary Articulate/Authorisation/AlwaysAllow.pm »