line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MouseX::AttributeHelpers::Number; |
2
|
5
|
|
|
13
|
|
2862
|
use Mouse; |
|
5
|
|
|
|
|
24
|
|
|
5
|
|
|
|
|
42
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
extends 'MouseX::AttributeHelpers::Base'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
has '+method_constructors' => ( |
7
|
|
|
|
|
|
|
default => sub { |
8
|
|
|
|
|
|
|
return +{ |
9
|
|
|
|
|
|
|
set => sub { |
10
|
|
|
|
|
|
|
my (undef, $name) = @_; |
11
|
12
|
|
|
12
|
|
4440
|
return sub { $_[0]->{$name} = $_[1] }; |
|
|
|
|
2
|
|
|
|
12
|
|
|
|
|
|
|
}, |
13
|
|
|
|
|
|
|
add => sub { |
14
|
|
|
|
|
|
|
my (undef, $name) = @_; |
15
|
10
|
|
|
10
|
|
16591
|
return sub { $_[0]->{$name} += $_[1] }; |
16
|
|
|
|
|
|
|
}, |
17
|
|
|
|
|
|
|
sub => sub { |
18
|
|
|
|
|
|
|
my (undef, $name) = @_; |
19
|
6
|
|
|
10
|
|
1146
|
return sub { $_[0]->{$name} -= $_[1] }; |
20
|
|
|
|
|
|
|
}, |
21
|
|
|
|
|
|
|
mul => sub { |
22
|
|
|
|
|
|
|
my (undef, $name) = @_; |
23
|
3
|
|
|
7
|
|
1060
|
return sub { $_[0]->{$name} *= $_[1] }; |
24
|
|
|
|
|
|
|
}, |
25
|
|
|
|
|
|
|
div => sub { |
26
|
|
|
|
|
|
|
my (undef, $name) = @_; |
27
|
6
|
|
|
8
|
|
1035
|
return sub { $_[0]->{$name} /= $_[1] }; |
28
|
|
|
|
|
|
|
}, |
29
|
|
|
|
|
|
|
mod => sub { |
30
|
|
|
|
|
|
|
my (undef, $name) = @_; |
31
|
9
|
|
|
13
|
|
1058
|
return sub { $_[0]->{$name} %= $_[1] }; |
32
|
|
|
|
|
|
|
}, |
33
|
|
|
|
|
|
|
abs => sub { |
34
|
|
|
|
|
|
|
my (undef, $name) = @_; |
35
|
3
|
|
|
9
|
|
21
|
return sub { $_[0]->{$name} = abs $_[0]->{$name} }; |
36
|
|
|
|
|
|
|
}, |
37
|
|
|
|
|
|
|
}; |
38
|
|
|
|
|
|
|
}, |
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
0
|
1
|
0
|
sub helper_type { 'Num' } |
42
|
|
|
|
|
|
|
|
43
|
5
|
|
|
5
|
|
3415
|
no Mouse; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
25
|
|
44
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(inline_constructor => 0); |
45
|
|
|
|
|
|
|
__END__ |