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;