line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Widget::Constraint::Number; |
2
|
|
|
|
|
|
|
|
3
|
88
|
|
|
88
|
|
70642
|
use warnings; |
|
88
|
|
|
|
|
215
|
|
|
88
|
|
|
|
|
7581
|
|
4
|
88
|
|
|
88
|
|
727
|
use strict; |
|
88
|
|
|
|
|
291
|
|
|
88
|
|
|
|
|
3579
|
|
5
|
88
|
|
|
88
|
|
493
|
use base 'HTML::Widget::Constraint'; |
|
88
|
|
|
|
|
202
|
|
|
88
|
|
|
|
|
7429
|
|
6
|
88
|
|
|
88
|
|
9653
|
use Scalar::Util qw( looks_like_number ); |
|
88
|
|
|
|
|
265
|
|
|
88
|
|
|
|
|
23167
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
HTML::Widget::Constraint::Number - Number Constraint |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $c = $widget->constraint( 'Number', 'foo' ); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 DESCRIPTION |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Number Constraint. |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 METHODS |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head2 validate |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=cut |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub validate { |
27
|
12
|
|
|
12
|
1
|
19
|
my ( $self, $value ) = @_; |
28
|
|
|
|
|
|
|
|
29
|
12
|
100
|
66
|
|
|
62
|
return 1 if !defined $value || $value eq ''; |
30
|
|
|
|
|
|
|
|
31
|
11
|
|
|
|
|
43
|
return looks_like_number($value); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 AUTHOR |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Carl Franks C |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 LICENSE |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
This library is free software, you can redistribute it and/or modify it under |
41
|
|
|
|
|
|
|
the same terms as Perl itself. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |