diff options
author | franck cuny <franck@lumberjaph.net> | 2010-06-28 08:18:45 +0200 |
---|---|---|
committer | franck cuny <franck@lumberjaph.net> | 2010-06-28 08:18:45 +0200 |
commit | 76c5d898ff9f46d14704284fa21f46373284b14f (patch) | |
tree | 7d408e9a521a6ce593246e0404dc043a2f7a0c1f /lib/presque | |
parent | remove rest client; use net::presque from now (diff) | |
download | presque-worker-76c5d898ff9f46d14704284fa21f46373284b14f.tar.gz |
context is the configuration
Diffstat (limited to '')
-rw-r--r-- | lib/presque/worker/Role/Context.pm | 20 |
1 files changed, 20 insertions, 0 deletions
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; |