I'm having difficulty getting a type coercion to work that involves Maybes.
I've looked at the deep coercion section of Moose::Manual::Types, and I'm
not sure what I'm missing to get this to work?
e.g. I'm running
perl -MData::Dumper -MObject -MDateTime -I. -wle'my
On Mon, Feb 15, 2010 at 04:25:54PM -0800, Karen Etheridge wrote:
I'm having difficulty getting a type coercion to work that involves Maybes.
I've looked at the deep coercion section of Moose::Manual::Types, and I'm
not sure what I'm missing to get this to work?
e.g. I'm running
perl
On Mon, Feb 15, 2010 at 06:31:24PM -0600, Jesse Luehrs wrote:
On Mon, Feb 15, 2010 at 04:25:54PM -0800, Karen Etheridge wrote:
I'm not sure what problem you're having, since you didn't post the
error message,
Oops sorry, it was:
Attribute (date) does not pass the type constraint because:
Here is slightly less verbose version
package Obj;
use Moose;
use Moose::Util::TypeConstraints;
use DateTime;
use DateTime::Format::MySQL;
class_type 'DateTime';
subtype 'MaybeDateTime' = as 'Maybe[DateTime]';
coerce 'MaybeDateTime'
= from 'Str'
= via {
# check for retarded mysql
I am likely to release this code tomorrow:
http://github.com/rjbs/moosex-worm
It seems pretty reasonable to me, but if I'm doing something totally wrong, I'd
love to find out now rather than later.
--
rjbs