File Coverage

blib/lib/HTML/FormFu/Constraint/SingleValue.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 0 2 0.0
total 13 15 86.6


line stmt bran cond sub pod time code
1 2     2   1058 use strict;
  2         5  
  2         128  
2              
3             package HTML::FormFu::Constraint::SingleValue;
4             $HTML::FormFu::Constraint::SingleValue::VERSION = '2.07';
5             # ABSTRACT: Single Value Constraint
6              
7 2     2   13 use Moose;
  2         4  
  2         17  
8             extends 'HTML::FormFu::Constraint';
9              
10             sub constrain_values {
11 1     1 0 3 my ( $self, $values ) = @_;
12              
13 1         13 die;
14             }
15              
16             sub constrain_value {
17 4     4 0 10 return 1;
18             }
19              
20             __PACKAGE__->meta->make_immutable;
21              
22             1;
23              
24             __END__
25              
26             =pod
27              
28             =encoding UTF-8
29              
30             =head1 NAME
31              
32             HTML::FormFu::Constraint::SingleValue - Single Value Constraint
33              
34             =head1 VERSION
35              
36             version 2.07
37              
38             =head1 DESCRIPTION
39              
40             Ensures that multiple values were not submitted for the named element.
41              
42             This constraint doesn't honour the C<not()> value.
43              
44             =head1 SEE ALSO
45              
46             Is a sub-class of, and inherits methods from L<HTML::FormFu::Constraint>
47              
48             L<HTML::FormFu>
49              
50             =head1 AUTHOR
51              
52             Carl Franks C<cfranks@cpan.org>
53              
54             =head1 LICENSE
55              
56             This library is free software, you can redistribute it and/or modify it under
57             the same terms as Perl itself.
58              
59             =head1 AUTHOR
60              
61             Carl Franks <cpan@fireartist.com>
62              
63             =head1 COPYRIGHT AND LICENSE
64              
65             This software is copyright (c) 2018 by Carl Franks.
66              
67             This is free software; you can redistribute it and/or modify it under
68             the same terms as the Perl 5 programming language system itself.
69              
70             =cut