line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Form::Processor::Field::IntRange; |
2
|
|
|
|
|
|
|
$Form::Processor::Field::IntRange::VERSION = '1.162360'; |
3
|
9
|
|
|
9
|
|
626
|
use strict; |
|
9
|
|
|
|
|
11
|
|
|
9
|
|
|
|
|
199
|
|
4
|
9
|
|
|
9
|
|
26
|
use warnings; |
|
9
|
|
|
|
|
10
|
|
|
9
|
|
|
|
|
201
|
|
5
|
9
|
|
|
9
|
|
26
|
use base 'Form::Processor::Field::Select'; |
|
9
|
|
|
|
|
8
|
|
|
9
|
|
|
|
|
3411
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use Rose::Object::MakeMethods::Generic ( |
9
|
9
|
|
|
|
|
36
|
scalar => [ |
10
|
|
|
|
|
|
|
label_format => { interface => 'get_set_init' }, |
11
|
|
|
|
|
|
|
], |
12
|
9
|
|
|
9
|
|
41
|
); |
|
9
|
|
|
|
|
9
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
0
|
0
|
0
|
sub init_range_start { return 1 } |
16
|
0
|
|
|
0
|
0
|
0
|
sub init_range_end { return 10 } |
17
|
5
|
|
|
5
|
0
|
32
|
sub init_label_format { return '%d' } |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub init_options { |
20
|
8
|
|
|
8
|
0
|
50
|
my $self = shift; |
21
|
|
|
|
|
|
|
|
22
|
8
|
|
|
|
|
29
|
my $start = $self->range_start; |
23
|
8
|
|
|
|
|
34
|
my $end = $self->range_end; |
24
|
|
|
|
|
|
|
|
25
|
8
|
|
|
|
|
18
|
for ( $start, $end ) { |
26
|
16
|
50
|
|
|
|
31
|
die 'Both range_start and range_end must be defined' unless defined $_; |
27
|
16
|
50
|
|
|
|
64
|
die 'Integer ranges must be integers' unless /^\d+$/; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
8
|
50
|
|
|
|
18
|
die 'range_start must be less than range_end' unless $start < $end; |
31
|
|
|
|
|
|
|
|
32
|
8
|
|
50
|
|
|
34
|
my $format = $self->label_format || die 'IntRange needs label_format'; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
return [ |
35
|
|
|
|
|
|
|
map { |
36
|
8
|
|
|
|
|
22
|
{ value => $_, label => sprintf( $format, $_ ) } |
|
223
|
|
|
|
|
388
|
|
37
|
|
|
|
|
|
|
} $self->range_start .. $self->range_end |
38
|
|
|
|
|
|
|
]; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
# ABSTRACT: Select an integer range in a select list |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |