Changeset 13411

Show
Ignore:
Timestamp:
06/07/08 21:41:11 (5 years ago)
Author:
tomyhero
Message:

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

Location:
lang/perl/FormValidator-LazyWay/branches/rebuild
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/FormValidator-LazyWay/branches/rebuild/lib/FormValidator/LazyWay.pm

    r13091 r13411  
    22 
    33use Moose; 
     4use FormValidator::LazyWay::Rule; 
     5use FormValidator::LazyWay::Message; 
     6use Carp; 
    47 
     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} 
    520 
    6211; 
     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 
  • lang/perl/FormValidator-LazyWay/branches/rebuild/lib/FormValidator/LazyWay/Utils.pm

    r13409 r13411  
    2727 
    2828        for my $key ( keys %$profile ) { 
    29             next if $key =~ m/^use_/ ; 
     29            next if $key =~ m/^use_/; 
    3030            push @invalid, $key unless ( $key eq any(@valid_profile_keys) ); 
    3131        } 
  • lang/perl/FormValidator-LazyWay/branches/rebuild/t/message.t

    r13409 r13411  
    44use FindBin; 
    55use File::Spec; 
    6 use YAML::Syck; 
    76use Data::Dumper; 
    87use lib File::Spec->catfile( $FindBin::Bin, 'lib' );