File Coverage

blib/lib/EntityModel/Web/NaFastCGI/Request.pm
Criterion Covered Total %
statement 4 4 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 6 6 100.0


line stmt bran cond sub pod time code
1             package EntityModel::Web::NaFastCGI::Request;
2             BEGIN {
3 1     1   1048 $EntityModel::Web::NaFastCGI::Request::VERSION = '0.002';
4             }
5             use EntityModel::Class {
6 1         13 _isa => [qw(EntityModel::Web::Request)],
7 1     1   1115 };
  1         326500  
8              
9             =head1 NAME
10              
11             EntityModel::Web::NaFastCGI::Request - abstraction for incoming HTTP request
12              
13             =head1 VERSION
14              
15             version 0.002
16              
17             =head1 SYNOPSIS
18              
19             use EntityModel::Web::Request;
20             my $req = EntityModel::Web::Request->new(
21             );
22              
23             =head1 DESCRIPTION
24              
25             =cut
26              
27             sub new {
28             my $class = shift;
29             my $r = shift;
30             my $param = $r->params;
31             my $self = $class->SUPER::new(
32             method => lc $param->{REQUEST_METHOD},
33             path => $param->{PATH_INFO},
34             version => '1.1',
35             header => [
36             { name => 'Host', value => $param->{HTTP_HOST} },
37             { name => 'User-Agent', value => $param->{HTTP_USER_AGENT} },
38             ]
39             );
40             return $self;
41             }
42              
43             1;
44              
45             __END__