| 1 | package FormValidator::Nested; | ||||||||||
| 2 | 18 | ▶ | use Any::Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 18 | ▶ | use namespace::clean -except => 'meta'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 18 | our $VERSION = '0.07'; | |||||||||
| 5 | |||||||||||
| 6 | 18 | ▶ | use FormValidator::Nested::ProfileProvider; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 18 | ▶ | use FormValidator::Nested::Messages::ja; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 18 | our $MESSAGES = $FormValidator::Nested::Messages::ja::MESSAGES; | |||||||||
| 10 | |||||||||||
| 11 | 18 | has 'profile_provider' => ( | |||||||||
| 12 | is => 'ro', | ||||||||||
| 13 | isa => 'FormValidator::Nested::ProfileProvider', | ||||||||||
| 14 | required => 1, | ||||||||||
| 15 | handles => [qw/get_profile/], | ||||||||||
| 16 | ); | ||||||||||
| 17 | 18 | __PACKAGE__->meta->make_immutable; | |||||||||
| 18 | |||||||||||
| 19 | 119 | ▶ | sub validate { | ||||||||
|
Subroutine
validate: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 20 | 119 | my $self = shift; | |||||||||
| 21 | 119 | my $req = shift; | |||||||||
| 22 | 119 | my $profile_key = shift; | |||||||||
| 23 | |||||||||||
| 24 | |||||||||||
| 25 | 119 | my $profile = $self->get_profile($profile_key); | |||||||||
| 26 | 119 | ▶ | if ( !$profile ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 1 | die("not found profile " . $profile_key); | |||||||||
| 28 | } | ||||||||||
| 29 | 118 | return $profile->validate($req); | |||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | 18 | 1; | |||||||||
| 33 | __END__ | ||||||||||