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