| 1 |
package Dancer2::Core::Role::Engine; |
| 2 |
# ABSTRACT: Role for engines |
| 3 |
$Dancer2::Core::Role::Engine::VERSION = '2.2.2'; |
| 4 |
use Moo::Role; |
| 5 |
use Dancer2::Core::Types; |
| 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 2.2.2 |
| 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) 2026 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 |