| Line | |
|---|
| 1 | package FormValidator::LazyWay; |
|---|
| 2 | |
|---|
| 3 | use Moose; |
|---|
| 4 | use FormValidator::LazyWay::Rule; |
|---|
| 5 | use FormValidator::LazyWay::Message; |
|---|
| 6 | use Carp; |
|---|
| 7 | |
|---|
| 8 | has config => ( is => 'ro' , isa => 'HashRef' ) ; |
|---|
| 9 | has rule => ( is => 'ro' , isa => 'FormValidator::LazyWay::Rule' ) ; |
|---|
| 10 | has message => ( is => 'ro' , isa => 'FormValidator::LazyWay::Message' ) ; |
|---|
| 11 | |
|---|
| 12 | sub BUILD { |
|---|
| 13 | my $self = shift; |
|---|
| 14 | croak 'you msue set config' unless $self->config; |
|---|
| 15 | my $rule = FormValidator::LazyWay::Rule->new( config => $self->config ); |
|---|
| 16 | my $message = FormValidator::LazyWay::Message->new( config => $self->config , rule => $rule ); |
|---|
| 17 | $self->{rule} = $rule; |
|---|
| 18 | $self->{message} = $message; |
|---|
| 19 | } |
|---|
| 20 | |
|---|
| 21 | 1; |
|---|
| 22 | |
|---|
| 23 | =head1 NAME |
|---|
| 24 | |
|---|
| 25 | FormValidator::LazyWay - Yet Another Form Validator |
|---|
| 26 | |
|---|
| 27 | =head1 SYNOPSYS |
|---|
| 28 | |
|---|
| 29 | my $fv = FormValidator::LazyWay->new( $config ); |
|---|
| 30 | |
|---|
| 31 | =head1 DESCRIPTION |
|---|
| 32 | |
|---|
| 33 | =head1 AUTHOR |
|---|
| 34 | |
|---|
| 35 | Tomohiro Teranishi <tomohiro.teranishi@gmail.com> |
|---|
| 36 | |
|---|
| 37 | =cut |
|---|