root/lang/perl/FormValidator-LazyWay/branches/rebuild/lib/FormValidator/LazyWay.pm @ 13411

Revision 13411, 0.9 kB (checked in by tomyhero, 6 years ago)

lang/perl/FormValidator::LazyWay? : implement LazyWay?->new() and test

Line 
1package FormValidator::LazyWay;
2
3use Moose;
4use FormValidator::LazyWay::Rule;
5use FormValidator::LazyWay::Message;
6use Carp;
7
8has config  => ( is => 'ro' , isa => 'HashRef' ) ;
9has rule    => ( is => 'ro' , isa => 'FormValidator::LazyWay::Rule' ) ;
10has message => ( is => 'ro' , isa => 'FormValidator::LazyWay::Message' ) ;
11
12sub 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
211;
22
23=head1 NAME
24
25FormValidator::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
35Tomohiro Teranishi <tomohiro.teranishi@gmail.com>
36
37=cut
Note: See TracBrowser for help on using the browser.