Request.pm 640 Bytes
Newer Older
Yadd's avatar
Yadd committed
1
2
3
4
5
6
7
package Lemonldap::NG::Portal::Main::Request;

use strict;
use Mouse;

extends 'Lemonldap::NG::Common::PSGI::Request';

Yadd's avatar
Yadd committed
8
# List of methods to call
Yadd's avatar
Yadd committed
9
has steps       => ( is => 'rw' );
Yadd's avatar
Yadd committed
10
11
12
13
14

# Datas shared between methods
has datas       => ( is => 'rw', default => sub { {} } );

# Session datas when created
Yadd's avatar
Yadd committed
15
has id          => ( is => 'rw' );
Yadd's avatar
Yadd committed
16
has sessionInfo => ( is => 'rw' );
Yadd's avatar
Yadd committed
17
18

# Response cookies (list of strings built by cookie())
Yadd's avatar
Yadd committed
19
has respCookies => ( is => 'rw' );
Yadd's avatar
Yadd committed
20

Yadd's avatar
Yadd committed
21
22
23
# Template to display (if not defined, login or menu)
has template    => ( is => 'rw' );

Yadd's avatar
Yadd committed
24
25
26
27
sub wantJSON {
    return $_[0]->accept =~ m#(?:application|text)/json# ? 1 : 0;
}

Yadd's avatar
Yadd committed
28
1;