| 1 | package Validator::Lazy::TestRole::ExtRoleExample; | ||
| 2 | |||
| 3 | 2 | our $VERSION = '0.03'; | |
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | Validator::Lazy::TestRole::ExtRoleExample | ||
| 8 | |||
| 9 | |||
| 10 | =head1 VERSION | ||
| 11 | |||
| 12 | Version 0.03 | ||
| 13 | |||
| 14 | |||
| 15 | =head1 SYNOPSIS | ||
| 16 | |||
| 17 | use Validator::Lazy; | ||
| 18 | my $v = Validator::Lazy->new( ); | ||
| 19 | |||
| 20 | my $ok = $v->check( Test => 'xxxxx' ); | ||
| 21 | |||
| 22 | |||
| 23 | =head1 DESCRIPTION | ||
| 24 | |||
| 25 | An example of external role definition. | ||
| 26 | |||
| 27 | |||
| 28 | =head1 METHODS | ||
| 29 | |||
| 30 | =head2 C<check> | ||
| 31 | |||
| 32 | Called from inside if Validator::Lazy->check process | ||
| 33 | |||
| 34 | Temporary overrides internal Validator::Lazy::check method like this: | ||
| 35 | |||
| 36 | $validator->check( $value, $param ); | ||
| 37 | |||
| 38 | |||
| 39 | =head1 SUPPORT AND DOCUMENTATION | ||
| 40 | |||
| 41 | After installing, you can find documentation for this module with the perldoc command. | ||
| 42 | |||
| 43 | perldoc Validator::Lazy | ||
| 44 | |||
| 45 | You can also look for information at: | ||
| 46 | |||
| 47 | RT, CPAN's request tracker (report bugs here) | ||
| 48 | http://rt.cpan.org/NoAuth/Bugs.html?Dist=Validator-Lazy | ||
| 49 | |||
| 50 | AnnoCPAN, Annotated CPAN documentation | ||
| 51 | http://annocpan.org/dist/Validator-Lazy | ||
| 52 | |||
| 53 | CPAN Ratings | ||
| 54 | http://cpanratings.perl.org/d/Validator-Lazy | ||
| 55 | |||
| 56 | Search CPAN | ||
| 57 | http://search.cpan.org/dist/Validator-Lazy/ | ||
| 58 | |||
| 59 | |||
| 60 | =head1 AUTHOR | ||
| 61 | |||
| 62 | ANTONC <antonc@cpan.org> | ||
| 63 | |||
| 64 | =head1 LICENSE | ||
| 65 | |||
| 66 | This program is free software; you can redistribute it and/or modify it | ||
| 67 | under the terms of the the Artistic License (2.0). You may obtain a | ||
| 68 | copy of the full license at: | ||
| 69 | |||
| 70 | L<http://www.perlfoundation.org/artistic_license_2_0> | ||
| 71 | |||
| 72 | =cut | ||
| 73 | |||
| 74 | 2 | ▶ | use v5.14.0; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 75 | 2 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 76 | 2 | ▶ | use Modern::Perl; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 77 | 2 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 78 | |||
| 79 | 1 | ▶ | sub before_check { |
|
Subroutine
before_check: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 80 | 1 | my ( $self, $value ) = @_; | |
| 81 | |||
| 82 | 1 | return $value + 1; | |
| 83 | }; | ||
| 84 | |||
| 85 | 1 | ▶ | sub check { |
|
Subroutine
check: called CC=1 SCAR=0.0
Pod
documented
| |||
| 86 | 1 | my ( $self, $value ) = @_; | |
| 87 | |||
| 88 | 1 | $self->add_error( ); | |
| 89 | 1 | $self->add_warning( ); | |
| 90 | |||
| 91 | 1 | return $value + 10; | |
| 92 | }; | ||
| 93 | |||
| 94 | 1 | ▶ | sub after_check { |
|
Subroutine
after_check: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 95 | 1 | my ( $self, $value ) = @_; | |
| 96 | |||
| 97 | 1 | return $value + 100; | |
| 98 | }; | ||
| 99 | |||
| 100 | 2 | 1; | |