Controllers/Controller.pm

filter: Statementstmt 100% 14 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 100% 18 / 18 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Controllers.pm ↑ Summary
1 package Dancer2::Controllers::Controller;
2  
3 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use MooseX::MethodAttributes;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use Dancer2;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 __PACKAGE__->meta->make_immutable();
9  
10 4 1;
11  
12 =encoding utf8
13  
14 =head1 NAME
15  
16 Dancer2::Controllers::Controller
17  
18 =head1 SYNOPSIS
19  
20 L<Moose> base class for creating controllers.
21  
22 =head1 EXAMPLE
23  
24 package MyApp::Controller;
25  
26 use Moose;
27  
28 BEGIN { extends 'Dancer2::Controllers::Controller' }
29  
30 sub hello_world : Route(get => /) {
31 "Hello World!";
32 }
33  
34 1;
35  
36 =head1 API
37  
38 =head2 Route attribute
39  
40 package MyApp::Controller;
41  
42 use Moose;
43  
44 BEGIN { extends 'Dancer2::Controllers::Controller' }
45  
46 sub hello_world : Route(get => /) {
47 "Hello World!";
48 }
49  
50 sub foo : Route(get => /foo/bar/:id[Int]) {
51 shift->request->params->{id};
52 }
53  
54 The route attribute is used to defined Dancer2 routes.
55  
« Controllers.pm ↑ Summary