File Coverage

blib/lib/EntityModel/Web/NaFastCGI/Response.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::Response;
2             BEGIN {
3 1     1   2462 $EntityModel::Web::NaFastCGI::Response::VERSION = '0.002';
4             }
5             use EntityModel::Class {
6 1         8 _isa => [qw(EntityModel::Web::Response)],
7             fcgi => 'EntityModel::Web::NaFastCGI',
8             context => 'EntityModel::Web::Context',
9 1     1   8 };
  1         2  
10              
11             =head1 NAME
12              
13             EntityModel::Web::Response - handle response to web request
14              
15             =head1 VERSION
16              
17             version 0.002
18              
19             =head1 SYNOPSIS
20              
21             =head1 DESCRIPTION
22              
23             =cut
24              
25             =head1 METHODS
26              
27             =cut
28              
29             sub new {
30             my ($class, $ctx, $r) = @_;
31             my $self = $class->SUPER::new;
32             $self->{context} = $ctx;
33             $self->{fcgi} = $r;
34             return $self;
35             }
36              
37             =head2 process
38              
39             Do the processing.
40              
41             FIXME 200 response only at the moment, clearly this isn't good enough.
42              
43             =cut
44              
45             sub process {
46             my $self = shift;
47             my $r = $self->fcgi;
48             $r->print_stdout("Status: 200 OK\r\n" .
49             "Content-Type: text/html\r\n" .
50             "\r\n" .
51             $self->context->process
52             );
53             $r->finish;
54             return $self;
55             }
56              
57             1;
58              
59             __END__