File Coverage

blib/lib/Catalyst/DispatchType.pm
Criterion Covered Total %
statement 7 8 87.5
branch n/a
condition n/a
subroutine 7 8 87.5
pod 5 5 100.0
total 19 21 90.4


line stmt bran cond sub pod time code
1             package Catalyst::DispatchType;
2              
3 155     155   90209 use Moose;
  155         582  
  155         1155  
4             with 'MooseX::Emulate::Class::Accessor::Fast';
5 155     155   1020283 no Moose;
  155         564  
  155         894  
6              
7             =head1 NAME
8              
9             Catalyst::DispatchType - DispatchType Base Class
10              
11             =head1 SYNOPSIS
12              
13             See L<Catalyst>.
14              
15             =head1 DESCRIPTION
16              
17             This is an abstract base class for Dispatch Types.
18              
19             From a code perspective, dispatch types are used to find which actions
20             to call for a given request URL. Website authors will typically work
21             with them via subroutine names attributes; a description of dispatch
22             at the attribute/URL level is given in L<Catalyst::Manual::Intro>.
23              
24             =head1 METHODS
25              
26             =head2 $self->list($c)
27              
28             abstract method, to be implemented by dispatchtypes. Called to display
29             info in debug log.
30              
31             =cut
32              
33       14 1   sub list { }
34              
35             =head2 $self->match( $c, $path )
36              
37             abstract method, to be implemented by dispatchtypes. Returns true if the
38             dispatch type matches the given path
39              
40             =cut
41              
42 0     0 1 0 sub match { die "Abstract method!" }
43              
44             =head2 $self->register( $c, $action )
45              
46             abstract method, to be implemented by dispatchtypes. Takes a
47             context object and a L<Catalyst::Action> object.
48              
49             Should return true if it registers something, or false otherwise.
50              
51             =cut
52              
53       1243 1   sub register { }
54              
55             =head2 $self->uri_for_action( $action, \@captures )
56              
57             abstract method, to be implemented by dispatchtypes. Takes a
58             L<Catalyst::Action> object and an arrayref of captures, and should
59             return either a URI part which if placed in $c->req->path would cause
60             $self->match to match this action and set $c->req->captures to the supplied
61             arrayref, or undef if unable to do so.
62              
63             =cut
64              
65       8 1   sub uri_for_action { }
66              
67             =head2 $self->expand_action
68              
69             Default fallback, returns nothing. See L<Catalyst::Dispatcher> for more info
70             about expand_action.
71              
72             =cut
73              
74       612 1   sub expand_action { }
75              
76 209621     209621   391762 sub _is_low_precedence { 0 }
77              
78             =head1 AUTHORS
79              
80             Catalyst Contributors, see Catalyst.pm
81              
82             =head1 COPYRIGHT
83              
84             This library is free software. You can redistribute it and/or modify it under
85             the same terms as Perl itself.
86              
87             =cut
88              
89             __PACKAGE__->meta->make_immutable;
90              
91             1;