File Coverage: lib/Yukki/Web/Controller.pm

# File Coverage

File: | lib/Yukki/Web/Controller.pm
Coverage: | 100.0%

line | stmt | bran | cond | sub | pod | time | code
--- | --- | --- | --- | --- | --- | --- | ---
1 |  |  |  |  |  |  | package Yukki::Web::Controller;
2 |
3 | 2 2 |  |  | 2 |  | 960 7 | use v5.24;
4 | 2 2 2 |  |  | 2 |  | 9 4 13 | use utf8;
5 | 2 2 2 |  |  | 2 |  | 38 4 11 | use Moo::Role;
6 |
7 | 2 2 2 |  |  | 2 |  | 660 5 16 | use Type::Utils;
8 |
9 | 2 2 2 |  |  | 2 |  | 3824 4 11 | use namespace::clean;
10 |
11 |  |  |  |  |  |  | # ABSTRACT: Base class for Yukki::Web controllers
12 |
13 - 23 |  |
    =head1 DESCRIPTION

    All L<Yukki::Web> controllers extend from here.

    =head1 ATTRIBUTES

    =head2 app

    This is the L<Yukki::Web> application.

    =cut
24 |
25 |  |  |  |  |  |  | has app => (
26 |  |  |  |  |  |  | is => 'ro',
27 |  |  |  |  |  |  | isa => class_type('Yukki::Web'),
28 |  |  |  |  |  |  | required => 1,
29 |  |  |  |  |  |  | weak_ref => 1,
30 |  |  |  |  |  |  | handles => 'Yukki::Role::App',
31 |  |  |  |  |  |  | );
32 |
33 - 43 |  |
    =head1 REQUIRED METHODS

    =head2 fire

      $controller->fire($context);

    Controllers must implement this method. This method will be given a
    L<Yukki::Web::Context> to work with. It is expected to fill in the
    L<Yukki::Web::Response> attached to that context or throw an exception.

    =cut
44 |
45 |  |  |  |  |  |  | requires 'fire';
46 |
47 |  |  |  |  |  |  | 1;