Hideaki Ohno > FormValidator-Lite-Constraint-Moose-0.05 > FormValidator::Lite::Constraint::Moose

Download:
FormValidator-Lite-Constraint-Moose-0.05.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.05   Source   Latest Release: FormValidator-Lite-Constraint-Moose-0.13

NAME ^

FormValidator::Lite::Constraint::Moose - Use Moose's type constraints.

SYNOPSIS ^

  use FormValidator::Lite;
  FormValidator::Lite->load_constraints(qw/Moose/);

  my $validator = FormValidator::Lite->new(CGI->new("flg=1"));
  $validator->check(
     flg => ['Bool']
 );

  #if you wanna use your original constraints.
  use FormValidator::Lite;
  use Any::Moose '::Util::TypeConstraints';

  enum 'HttpMethod' => qw(GET HEAD POST PUT DELETE); #you must load before load 'FormValidator::Lite->load_constraints(qw/Moose/)'

  FormValidator::Lite->load_constraints(qw/Moose/);

  my $validator = FormValidator::Lite->new(CGI->new("req_type=GET"));
  $validator->check(
     "req_type => ['HttpMethod']
 );

DESCRIPTION ^

This module provides Mo[o|u]se's type constraint as constraint rule of FormValidator::Lite If you wanna know the constraint, see Moose::Util::TypeConstraints for details.

AUTHOR ^

Hideaki Ohno <hide.o.j55 {at} gmail.com>

SEE ALSO ^

FormValidator::Lite,Moose::Util::TypeConstraints

LICENSE ^

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: