File Coverage

blib/lib/WWW/ClickSource/Request.pm
Criterion Covered Total %
statement 11 13 84.6
branch 3 4 75.0
condition n/a
subroutine 3 3 100.0
pod 1 1 100.0
total 18 21 85.7


line stmt bran cond sub pod time code
1             package WWW::ClickSource::Request;
2              
3 9     9   59 use strict;
  9         20  
  9         268  
4 9     9   45 use warnings;
  9         13  
  9         1262  
5              
6             =head1 NAME
7              
8             WWW::ClickSource::Request - Generic Request object that contains the info we need about the request
9              
10             =head1 DESCRIPTION
11              
12             Simple object that contains the data we need in order to dectect where the user came from
13              
14             =head1 METHODS
15              
16             =head2 new
17              
18             Creates a new C object
19              
20             =cut
21             sub new {
22 24     24 1 47 my ($class,$request) = @_;
23            
24 24 50       77 if (ref($request) eq "Catalyst::Request") {
25 0         0 require WWW::ClickSource::Request::CatalystRequest;
26 0         0 return WWW::ClickSource::Request::CatalystRequest->new($request);
27             }
28             else {
29             my $self = {
30             host => $request->{host},
31             params => $request->{params},
32 24 100       109 referer => $request->{referer} ? URI->new($request->{referer}) : undef,
33             };
34            
35 24         64221 bless $self, $class;
36            
37 24         77 return $self;
38             }
39             }
40              
41             1;
42              
43             =head1 AUTHOR
44              
45             Gligan Calin Horea, C<< >>
46              
47             =head1 REPOSITORY
48              
49             L
50              
51             =head1 BUGS
52              
53             Please report any bugs or feature requests to C, or through
54             the web interface at L. I will be notified, and then you'll
55             automatically be notified of progress on your bug as I make changes.
56              
57              
58             =head1 SUPPORT
59              
60             You can find documentation for this module with the perldoc command.
61              
62             perldoc WWW::ClickSource::Request
63              
64              
65             You can also look for information at:
66              
67             =over 4
68              
69             =item * RT: CPAN's request tracker (report bugs here)
70              
71             L
72              
73             =item * AnnoCPAN: Annotated CPAN documentation
74              
75             L
76              
77             =item * CPAN Ratings
78              
79             L
80              
81             =item * Search CPAN
82              
83             L
84              
85             =back
86              
87             =head1 LICENSE AND COPYRIGHT
88              
89             Copyright 2016 Gligan Calin Horea.
90              
91             This program is free software; you can redistribute it and/or modify it
92             under the terms of either: the GNU General Public License as published
93             by the Free Software Foundation; or the Artistic License.
94              
95             See http://dev.perl.org/licenses/ for more information.
96              
97              
98             =cut