Hi,

On Fri, Jun 18, 2010 at 7:44 PM, Evan Carroll <[email protected]> wrote:
> Actually you can do this with MX::Types too:
>
> use MooseX::Types -declare => [qw( MyDate DateTime )];
> use MooseX::Types::Moose qw( Str Int HashRef Object );
> use DateTime;
>
> class_type DateTime, { class => 'DateTime' };
>
> subtype MyDate, as DateTime, where { ! $_->hour };

hmms... I had code like that in a previous version but could not get
it to work. The difference is that you added ", where { ! $_->hour }"
and I had only "subtype MyDate, as DateTime;".

In fact if I remove the "where..." from you working example, the tests
start failing like mine did. I would like to understand why it needs
the where to work. Back to the docs for me.

Thank you for the working example, fixed my project.

Bye,
-- 
Pedro Melo
http://www.simplicidade.org/
xmpp:[email protected]
mailto:[email protected]

Reply via email to