File Coverage

blib/lib/Dancer2/Core/Role/Engine.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package Dancer2::Core::Role::Engine;
2             # ABSTRACT: Role for engines
3             $Dancer2::Core::Role::Engine::VERSION = '1.0.0';
4 148     148   87029 use Moo::Role;
  148         604  
  148         1026  
5 148     148   67191 use Dancer2::Core::Types;
  148         700  
  148         1245  
6              
7             with 'Dancer2::Core::Role::Hookable';
8              
9             has session => (
10             is => 'ro',
11             isa => InstanceOf['Dancer2::Core::Session'],
12             writer => 'set_session',
13             clearer => 'clear_session',
14             predicate => 'has_session',
15             );
16              
17             has config => (
18             is => 'ro',
19             isa => HashRef,
20             default => sub { {} },
21             );
22              
23             has request => (
24             is => 'ro',
25             isa => InstanceOf['Dancer2::Core::Request'],
26             writer => 'set_request',
27             clearer => 'clear_request',
28             predicate => 'has_request',
29             );
30              
31             1;
32              
33             __END__
34              
35             =pod
36              
37             =encoding UTF-8
38              
39             =head1 NAME
40              
41             Dancer2::Core::Role::Engine - Role for engines
42              
43             =head1 VERSION
44              
45             version 1.0.0
46              
47             =head1 DESCRIPTION
48              
49             This role is intended to be consumed by all engine roles. It contains all the
50             shared logic for engines.
51              
52             This role consumes the L<Dancer2::Core::Role::Hookable> role.
53              
54             =head1 ATTRIBUTES
55              
56             =head2 config
57              
58             An HashRef that hosts the configuration bits for the engine.
59              
60             =head1 AUTHOR
61              
62             Dancer Core Developers
63              
64             =head1 COPYRIGHT AND LICENSE
65              
66             This software is copyright (c) 2023 by Alexis Sukrieh.
67              
68             This is free software; you can redistribute it and/or modify it under
69             the same terms as the Perl 5 programming language system itself.
70              
71             =cut