summary refs log tree commit diff
path: root/lib/presque/worker/Role/Context.pm
blob: 5eccf7b0ca1e1c1fd0b2aa8043efbe9b08b785e8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package presque::worker::Role::Context;

use YAML;

use Moose::Role;
use Moose::Util::TypeConstraints;

subtype 'Context' => as 'HashRef';

coerce 'Context' => from 'Str' => via { Load $_; };

has context => (
    is      => 'rw',
    isa     => 'Context',
    lazy    => 1,
    coerce  => 1,
    default => {{}},
);

1;