line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: A Number Object for Perl 5 |
2
|
|
|
|
|
|
|
package Data::Object::Number; |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
544
|
use 5.10.0; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
37
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
2209
|
use Moo 'with'; |
|
1
|
|
|
|
|
22595
|
|
|
1
|
|
|
|
|
7
|
|
7
|
1
|
|
|
1
|
|
2081
|
use Scalar::Util 'blessed'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
110
|
|
8
|
1
|
|
|
1
|
|
1304
|
use Types::Standard 'Num'; |
|
1
|
|
|
|
|
106909
|
|
|
1
|
|
|
|
|
13
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
with 'Data::Object::Role::Number'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.02'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
16
|
0
|
|
|
|
|
|
my $data = shift; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
0
|
|
|
|
$class = ref($class) || $class; |
19
|
0
|
0
|
0
|
|
|
|
$data = Num->($data) |
20
|
|
|
|
|
|
|
unless blessed($data) && $data->isa($class); |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
return bless \$data, $class; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |