line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: A Scalar Object for Perl 5 |
2
|
|
|
|
|
|
|
package Data::Object::Scalar; |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
733
|
use 5.10.0; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
497
|
use Moo 'with'; |
|
1
|
|
|
|
|
13168
|
|
|
1
|
|
|
|
|
5
|
|
7
|
1
|
|
|
1
|
|
1519
|
use Scalar::Util 'blessed'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
87
|
|
8
|
1
|
|
|
1
|
|
586
|
use Types::Standard 'Defined'; |
|
1
|
|
|
|
|
61009
|
|
|
1
|
|
|
|
|
16
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
with 'Data::Object::Role::Scalar'; |
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 = Defined->($data) |
20
|
|
|
|
|
|
|
unless blessed($data) && $data->isa($class); |
21
|
|
|
|
|
|
|
|
22
|
0
|
0
|
|
|
|
|
return bless ref($data) ? $data : \$data, $class; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |