GX/Response.pm

filter: Statementstmt 76.4% 13 / 17 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 4 / 8 Podpod 100% 4 / 4 totaltotal 60.0% 21 / 35 CC 4 SCAR 13.4
CC
4
Cov
57%
has_body
6.0
has_cookies
6.0
has_headers
6.0
CRAP 3.8
« GX/HTTP/Upload.pm ↑ Summary GX/HTTP/Status.pm »
1 # ----------------------------------------------------------------------------------------------------------------------
2 # GX Framework (c) 2009-2011 Jörg A. Uzarek <uzarek@runlevelnull.de>
3 # File: GX/Response.pm
4 # ----------------------------------------------------------------------------------------------------------------------
5  
6 package GX::Response;
7  
8 4 ▶use GX::HTTP::Response::Cookies;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10  
11 # ----------------------------------------------------------------------------------------------------------------------
12 # Class setup
13 # ----------------------------------------------------------------------------------------------------------------------
14  
15 4 ▶use GX::Class;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 4 extends qw( GX::Component GX::HTTP::Response );
18  
19 4 has 'cookies' => (
20 isa => 'Scalar',
21 initializer => '_initialize_cookies'
22 );
23  
24 4 build;
25  
26  
27 # ----------------------------------------------------------------------------------------------------------------------
28 # Export mechanism
29 # ----------------------------------------------------------------------------------------------------------------------
30  
31 4 __PACKAGE__->_install_import_method;
32  
33  
34 # ----------------------------------------------------------------------------------------------------------------------
35 # Public methods
36 # ----------------------------------------------------------------------------------------------------------------------
37  
38 0 ▶sub cookie {
Subroutine cookie: not called CC=1 SCAR=6.9
Pod documented
39  
40 0 return shift->cookies->get( @_ );
41  
42 }
43  
44 0 ▶sub has_body {
Subroutine has_body: not called CC=2 SCAR=17.9
Pod documented
45  
46 0 ▶ return $_[0]->body->length ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$_[0]->body->length ? : 0 0 0
47  
48 }
49  
50 0 ▶sub has_cookies {
Subroutine has_cookies: not called CC=2 SCAR=17.9
Pod documented
51  
52 0 ▶ return $_[0]->cookies->count ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$_[0]->cookies->count ? : 0 0 0
53  
54 }
55  
56 0 ▶sub has_headers {
Subroutine has_headers: not called CC=2 SCAR=17.9
Pod documented
57  
58 0 ▶ return $_[0]->headers->count ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$_[0]->headers->count ? : 0 0 0
59  
60 }
61  
62  
63 # ----------------------------------------------------------------------------------------------------------------------
64 # Private methods
65 # ----------------------------------------------------------------------------------------------------------------------
66  
67 4 ▶sub _initialize_cookies {
Subroutine _initialize_cookies: called CC=1 SCAR=0.0
68  
69 4 return GX::HTTP::Response::Cookies->new;
70  
71 }
72  
73 2 ▶sub _validate_class_name {
Subroutine _validate_class_name: called CC=1 SCAR=0.0
74  
75 2 return $_[1] =~ /^(?:[_a-zA-Z]\w*::)+Response$/;
76  
77 }
78  
79  
80 4 1;
81  
82 __END__
« GX/HTTP/Upload.pm ↑ Summary GX/HTTP/Status.pm »