From 76c5d898ff9f46d14704284fa21f46373284b14f Mon Sep 17 00:00:00 2001 From: franck cuny Date: Mon, 28 Jun 2010 08:18:45 +0200 Subject: context is the configuration --- lib/presque/worker/Role/Context.pm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lib/presque/worker/Role/Context.pm (limited to 'lib/presque/worker/Role') diff --git a/lib/presque/worker/Role/Context.pm b/lib/presque/worker/Role/Context.pm new file mode 100644 index 0000000..5eccf7b --- /dev/null +++ b/lib/presque/worker/Role/Context.pm @@ -0,0 +1,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; -- cgit 1.4.1