Hector/Base.pm

filter: Statementstmt 100% 16 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 66.6% 2 / 3 totaltotal 95.8% 23 / 24 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
new
1.0
CRAP 1.0
« Hector/Response/Base.pm ↑ Summary Hector/Utils.pm »
1 package PSGI::Hector::Base;
2  
3 =pod
4  
5 =head1 NAME
6  
7 PSGI::Hector::Base - Base Hector class
8  
9 =head1 SYNOPSIS
10  
11 my $r = $hector->getRequest();
12 my $params = $r->getParameters();
13  
14 =head1 DESCRIPTION
15  
16 Abstract class used in all other PSGI::Hector classes.
17  
18 =head1 METHODS
19  
20 =cut
21  
22 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 ###########################################################
25 8 ▶sub new{
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
26 8 my $class = shift;
27 8 my $self = {
28 '_error' => undef
29 };
30 8 bless $self, $class;
31 8 return $self;
32 }
33 #########################################################
34  
35 =head2 setError($mesage)
36  
37 $obj->setError($message);
38  
39 Sets an error on the object, the message can be retrieved later.
40  
41 =cut
42  
43 #########################################################
44 1 ▶sub setError{
Subroutine setError: called CC=1 SCAR=0.0
Pod documented
45 1 my($self, $error) = @_;
46 1 $self->{'_error'} = $error;
47 1 return 1;
48 }
49 #########################################################
50  
51 =pod
52  
53 =head2 getError()
54  
55 $error = $obj->getError();
56  
57 Retrieve a previously set error message. This method is used to
58 determine the object's error state.
59  
60 =cut
61  
62 #########################################################
63 9 ▶sub getError{
Subroutine getError: called CC=1 SCAR=0.0
Pod documented
64 9 my $self = shift;
65 9 return $self->{'_error'};
66 }
67 ###########################################################
68  
69 =pod
70  
71 =head1 Notes
72  
73 =head1 Author
74  
75 MacGyveR <dumb@cpan.org>
76  
77 Development questions, bug reports, and patches are welcome to the above address.
78  
79 =head1 See Also
80  
81 =head1 Copyright
82  
83 Copyright (c) 2017 MacGyveR. All rights reserved.
84  
85 This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
86  
87 =cut
88  
89 ##########################################################
90 5 return 1;
« Hector/Response/Base.pm ↑ Summary Hector/Utils.pm »