line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Number::Object; |
2
|
|
|
|
|
|
|
|
3
|
13
|
|
|
13
|
|
1014066
|
use strict; |
|
13
|
|
|
|
|
34
|
|
|
13
|
|
|
|
|
507
|
|
4
|
13
|
|
|
13
|
|
68
|
use warnings; |
|
13
|
|
|
|
|
26
|
|
|
13
|
|
|
|
|
553
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
6
|
|
|
|
|
|
|
|
7
|
13
|
|
|
13
|
|
15820
|
use Class::Component; |
|
13
|
|
|
|
|
251294
|
|
|
13
|
|
|
|
|
190
|
|
8
|
13
|
|
|
13
|
|
1131
|
use Carp (); |
|
13
|
|
|
|
|
28
|
|
|
13
|
|
|
|
|
209
|
|
9
|
13
|
|
|
13
|
|
73
|
use Scalar::Util (); |
|
13
|
|
|
|
|
27
|
|
|
13
|
|
|
|
|
178
|
|
10
|
13
|
|
|
13
|
|
25860
|
use Storable (); |
|
13
|
|
|
|
|
57021
|
|
|
13
|
|
|
|
|
485
|
|
11
|
|
|
|
|
|
|
|
12
|
13
|
|
|
13
|
|
9310
|
use Number::Object::Filter; |
|
13
|
|
|
|
|
38
|
|
|
13
|
|
|
|
|
151
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
use overload ( |
15
|
|
|
|
|
|
|
q{""} => \&to_s, |
16
|
|
|
|
|
|
|
q{0+} => \&to_n, |
17
|
0
|
|
|
0
|
|
0
|
q{++} => sub { Carp::croak '"++"(mutators) is unsupported operation' }, |
18
|
0
|
|
|
0
|
|
0
|
q{--} => sub { Carp::croak '"--"(mutators) is unsupported operation' }, |
19
|
13
|
|
|
|
|
210
|
fallback => 1, |
20
|
13
|
|
|
13
|
|
1285
|
); |
|
13
|
|
|
|
|
22
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new { |
23
|
49
|
|
|
49
|
1
|
194137
|
my $class = shift; |
24
|
49
|
|
|
|
|
90
|
my $value = shift; |
25
|
49
|
|
|
|
|
289
|
my $self = $class->NEXT( new => @_ ); |
26
|
|
|
|
|
|
|
|
27
|
49
|
|
|
|
|
38205
|
$self->value($value); |
28
|
|
|
|
|
|
|
|
29
|
49
|
|
|
|
|
156
|
$self; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub clone { |
33
|
24
|
|
|
24
|
1
|
40
|
my($self, $value) = @_; |
34
|
24
|
|
|
|
|
2509
|
my $clone = Storable::dclone($self); |
35
|
24
|
50
|
|
|
|
105
|
$clone->value($value) if defined $value; |
36
|
24
|
|
|
|
|
143
|
$clone; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub value { |
40
|
411
|
|
|
411
|
1
|
639
|
my($self, $value) = @_; |
41
|
411
|
100
|
|
|
|
2015
|
return $self->{value} unless defined $value; |
42
|
73
|
|
|
|
|
369
|
$self->run_hook( 'value.set' => { value => $value } ); |
43
|
73
|
|
|
|
|
1479
|
$self->{value} = $value; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub filtered { |
47
|
6
|
|
|
6
|
1
|
2182
|
my $self = shift; |
48
|
6
|
|
|
|
|
11
|
my $value = $self->value; |
49
|
6
|
|
|
|
|
27
|
Number::Object::Filter->execute($self, $value, @_); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
332
|
|
|
332
|
0
|
4322
|
sub to_s { shift->value } |
53
|
|
|
|
|
|
|
*to_n = *to_s; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
56
|
|
|
|
|
|
|
__END__ |