From b39ba35be27f03578af985c08f91dd13e6ee1e15 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 19 Dec 2010 11:30:37 -0600 Subject: allow crypt to be specified without crypt_key --- lib/KiokuDB/Serializer/Crypt.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/KiokuDB/Serializer/Crypt.pm b/lib/KiokuDB/Serializer/Crypt.pm index 9b52e5a..0eadbd1 100644 --- a/lib/KiokuDB/Serializer/Crypt.pm +++ b/lib/KiokuDB/Serializer/Crypt.pm @@ -37,9 +37,12 @@ C in L. =cut has crypt_key => ( - is => 'ro', - isa => 'Str', - required => 1, + is => 'ro', + isa => 'Str', + default => sub { + confess "The 'crypt_key' attribute for " . blessed($self) + . " is required if the 'crypt' attribute is not given"; + }, ); =attr crypt_cipher -- cgit v1.2.3-54-g00ecf