Andrew Sterling Hanenkamp > Form-Factory > Form::Factory::Feature::Control::MatchCode

Download:
Form-Factory-0.020.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.020   Source  

NAME ^

Form::Factory::Feature::Control::MatchCode - Greps the control value for correctness

VERSION ^

version 0.020

SYNOPSIS ^

  has_control even_value => (
      control => 'text',
      features => {
          match_code => {
              message => 'the value in %s is not even',
              code    => sub { shift % 2 == 0 },
          },
      },
  );

DESCRIPTION ^

Runs the control value against a code reference during the check. If that code reference returns a false value, an error is generated.

ATTRIBUTES ^

code

This is the code reference. It should expect a single argument to be passed, which is the value to check.

METHODS ^

check_control

No op.

check

Does the work of running the given subroutine over the control value and reports an error if the code reference runs and returns a false value.

AUTHOR ^

Andrew Sterling Hanenkamp <hanenkamp@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright 2009 Qubling Software LLC.

This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: