File Coverage

blib/lib/HTML/FormFu/Constraint/File/MaxSize.pm
Criterion Covered Total %
statement 8 8 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 11 11 100.0


line stmt bran cond sub pod time code
1             package HTML::FormFu::Constraint::File::MaxSize;
2              
3 2     2   623 use strict;
  2         3  
  2         87  
4             our $VERSION = '2.05'; # VERSION
5              
6 2     2   8 use Moose;
  2         2  
  2         13  
7             extends 'HTML::FormFu::Constraint::File::Size';
8              
9             sub _localize_args {
10 1     1   2 my ($self) = @_;
11              
12 1         9 return $self->max;
13             }
14              
15             __PACKAGE__->meta->make_immutable;
16              
17             1;
18              
19             __END__
20              
21             =head1 NAME
22              
23             HTML::FormFu::Constraint::File::MaxSize - Maximum File Size Constraint
24              
25             =head1 VERSION
26              
27             version 2.05
28              
29             =head1 DESCRIPTION
30              
31             Ensure that an uploaded file meets maximum size constraints.
32              
33             Overrides L<HTML::FormFu::Constraint/localize_args>, so that the value of
34             L</maximum> is passed as an argument to L<localize|HTML::FormFu/localize>.
35              
36             This constraint doesn't honour the C<not()> value.
37              
38             =head1 METHODS
39              
40             =head2 maximum
41              
42             =head2 max
43              
44             The maximum file size in bytes.
45              
46             L</max> is an alias for L</maximum>.
47              
48             =head1 SEE ALSO
49              
50             Is a sub-class of, and inherits methods from
51             L<HTML::FormFu::Constraint::File::Size>, L<HTML::FormFu::Constraint>
52              
53             L<HTML::FormFu>
54              
55             =head1 AUTHOR
56              
57             Carl Franks C<cfranks@cpan.org>
58              
59             =head1 LICENSE
60              
61             This library is free software, you can redistribute it and/or modify it under
62             the same terms as Perl itself.
63              
64             =cut