File Coverage

blib/lib/Pinto/Server/Responder.pm
Criterion Covered Total %
statement 9 10 90.0
branch n/a
condition n/a
subroutine 3 4 75.0
pod 1 1 100.0
total 13 15 86.6


line stmt bran cond sub pod time code
1             # ABSTRACT: Base class for responders
2              
3             package Pinto::Server::Responder;
4              
5 13     13   5933 use Moose;
  13         27  
  13         69  
6              
7 13     13   77778 use Carp;
  13         29  
  13         738  
8              
9 13     13   78 use Pinto::Types qw(Dir);
  13         26  
  13         120  
10              
11             #-------------------------------------------------------------------------------
12              
13             our $VERSION = '0.13'; # VERSION
14              
15             #-------------------------------------------------------------------------------
16              
17             has request => (
18             is => 'ro',
19             isa => 'Plack::Request',
20             required => 1,
21             );
22              
23             has root => (
24             is => 'ro',
25             isa => Dir,
26             required => 1,
27             );
28              
29             #-------------------------------------------------------------------------------
30              
31              
32 0     0 1   sub respond { croak 'abstract method' }
33              
34             #-------------------------------------------------------------------------------
35              
36             __PACKAGE__->meta->make_immutable;
37              
38             #-------------------------------------------------------------------------------
39              
40             1;
41              
42             __END__
43              
44             =pod
45              
46             =encoding UTF-8
47              
48             =for :stopwords Jeffrey Ryan Thalhammer responders
49              
50             =head1 NAME
51              
52             Pinto::Server::Responder - Base class for responders
53              
54             =head1 VERSION
55              
56             version 0.13
57              
58             =head1 METHODS
59              
60             =head2 respond( $request )
61              
62             Given a L<Plack::Request>, responds with the appropriate
63             PSGI-compatible response. This is an abstract method. It is your job
64             to implement it in a concrete subclass.
65              
66             =head1 AUTHOR
67              
68             Jeffrey Ryan Thalhammer <jeff@stratopan.com>
69              
70             =head1 COPYRIGHT AND LICENSE
71              
72             This software is copyright (c) 2015 by Jeffrey Ryan Thalhammer.
73              
74             This is free software; you can redistribute it and/or modify it under
75             the same terms as the Perl 5 programming language system itself.
76              
77             =cut